
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module gdata.gauth</title>
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="gdata.html"><font color="#ffffff">gdata</font></a>.gauth</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/gauth.py">/usr/local/google/home/afshar/src/external-gdata-release/google3/src/gdata/gauth.py</a></font></td></tr></table>
    <p><tt>Provides&nbsp;auth&nbsp;related&nbsp;token&nbsp;classes&nbsp;and&nbsp;functions&nbsp;for&nbsp;Google&nbsp;Data&nbsp;APIs.<br>
&nbsp;<br>
Token&nbsp;classes&nbsp;represent&nbsp;a&nbsp;user's&nbsp;authorization&nbsp;of&nbsp;this&nbsp;app&nbsp;to&nbsp;access&nbsp;their<br>
data.&nbsp;Usually&nbsp;these&nbsp;are&nbsp;not&nbsp;created&nbsp;directly&nbsp;but&nbsp;by&nbsp;a&nbsp;GDClient&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
<a href="#ClientLoginToken">ClientLoginToken</a><br>
<a href="#AuthSubToken">AuthSubToken</a><br>
<a href="#SecureAuthSubToken">SecureAuthSubToken</a><br>
<a href="#OAuthHmacToken">OAuthHmacToken</a><br>
<a href="#OAuthRsaToken">OAuthRsaToken</a><br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a><br>
<a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a><br>
&nbsp;<br>
Functions&nbsp;which&nbsp;are&nbsp;often&nbsp;used&nbsp;in&nbsp;application&nbsp;code&nbsp;(as&nbsp;opposed&nbsp;to&nbsp;just&nbsp;within<br>
the&nbsp;gdata-python-client&nbsp;library)&nbsp;are&nbsp;the&nbsp;following:<br>
&nbsp;<br>
generate_auth_sub_url<br>
authorize_request_token<br>
&nbsp;<br>
The&nbsp;following&nbsp;are&nbsp;helper&nbsp;functions&nbsp;which&nbsp;are&nbsp;used&nbsp;to&nbsp;save&nbsp;and&nbsp;load&nbsp;auth&nbsp;token<br>
objects&nbsp;in&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.&nbsp;These&nbsp;should&nbsp;only&nbsp;be&nbsp;used&nbsp;if&nbsp;you&nbsp;are&nbsp;using<br>
this&nbsp;library&nbsp;within&nbsp;App&nbsp;Engine:<br>
&nbsp;<br>
ae_load<br>
ae_save</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="atom.html">atom</a><br>
<a href="datetime.html">datetime</a><br>
</td><td width="25%" valign=top><a href="random.html">random</a><br>
<a href="simplejson.html">simplejson</a><br>
</td><td width="25%" valign=top><a href="time.html">time</a><br>
<a href="urllib.html">urllib</a><br>
</td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
    
<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#SecureAuthSubToken">SecureAuthSubToken</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#ClientLoginToken">ClientLoginToken</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2TokenFromCredentials">OAuth2TokenFromCredentials</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a>
</font></dt></dl>
</dd>
</dl>
</dd>
<dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#Error">Error</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2AccessTokenError">OAuth2AccessTokenError</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.gauth.html#OAuth2RevokeError">OAuth2RevokeError</a>
</font></dt><dt><font face="helvetica, arial"><a href="gdata.gauth.html#UnsupportedTokenType">UnsupportedTokenType</a>
</font></dt></dl>
</dd>
</dl>
</dd>
</dl>
 <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="AuthSubToken">class <strong>AuthSubToken</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="AuthSubToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#AuthSubToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="AuthSubToken-__init__"><strong>__init__</strong></a>(self, token_string, scopes<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="AuthSubToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;Authorization&nbsp;header,&nbsp;allows&nbsp;app&nbsp;to&nbsp;act&nbsp;on&nbsp;the&nbsp;user's&nbsp;behalf.</tt></dd></dl>

<hr>
Static methods defined here:<br>
<dl><dt><a name="AuthSubToken-FromUrl"><strong>FromUrl</strong></a> = from_url(str_or_uri)</dt><dd><tt>Creates&nbsp;a&nbsp;new&nbsp;<a href="#AuthSubToken">AuthSubToken</a>&nbsp;using&nbsp;information&nbsp;in&nbsp;the&nbsp;URL.<br>
&nbsp;<br>
Uses&nbsp;auth_sub_string_from_url.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;str_or_uri:&nbsp;The&nbsp;current&nbsp;page's&nbsp;URL&nbsp;(as&nbsp;a&nbsp;str&nbsp;or&nbsp;atom.http_core.Uri)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;should&nbsp;contain&nbsp;a&nbsp;token&nbsp;query&nbsp;parameter&nbsp;since&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Google&nbsp;auth&nbsp;server&nbsp;redirected&nbsp;the&nbsp;user's&nbsp;browser&nbsp;to&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL.</tt></dd></dl>

<dl><dt><a name="AuthSubToken-from_url"><strong>from_url</strong></a>(str_or_uri)</dt><dd><tt>Creates&nbsp;a&nbsp;new&nbsp;<a href="#AuthSubToken">AuthSubToken</a>&nbsp;using&nbsp;information&nbsp;in&nbsp;the&nbsp;URL.<br>
&nbsp;<br>
Uses&nbsp;auth_sub_string_from_url.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;str_or_uri:&nbsp;The&nbsp;current&nbsp;page's&nbsp;URL&nbsp;(as&nbsp;a&nbsp;str&nbsp;or&nbsp;atom.http_core.Uri)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;should&nbsp;contain&nbsp;a&nbsp;token&nbsp;query&nbsp;parameter&nbsp;since&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Google&nbsp;auth&nbsp;server&nbsp;redirected&nbsp;the&nbsp;user's&nbsp;browser&nbsp;to&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="ClientLoginToken">class <strong>ClientLoginToken</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="ClientLoginToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#ClientLoginToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="ClientLoginToken-__init__"><strong>__init__</strong></a>(self, token_string)</dt></dl>

<dl><dt><a name="ClientLoginToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#Error-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>

<dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>

<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2AccessTokenError">class <strong>OAuth2AccessTokenError</strong></a>(<a href="gdata.gauth.html#Error">Error</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Raised&nbsp;when&nbsp;an&nbsp;OAuth2&nbsp;error&nbsp;occurs.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuth2AccessTokenError">OAuth2AccessTokenError</a></dd>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuth2AccessTokenError-__init__"><strong>__init__</strong></a>(self, error_message)</dt></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#OAuth2AccessTokenError-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="OAuth2AccessTokenError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="OAuth2AccessTokenError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="OAuth2AccessTokenError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2AccessTokenError-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>

<dl><dt><a name="OAuth2AccessTokenError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>

<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2RevokeError">class <strong>OAuth2RevokeError</strong></a>(<a href="gdata.gauth.html#Error">Error</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Raised&nbsp;when&nbsp;an&nbsp;OAuth2&nbsp;token&nbsp;revocation&nbsp;was&nbsp;unsuccessful.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuth2RevokeError">OAuth2RevokeError</a></dd>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuth2RevokeError-__init__"><strong>__init__</strong></a>(self, http_response, response_body<font color="#909090">=None</font>)</dt><dd><tt>Sets&nbsp;the&nbsp;HTTP&nbsp;information&nbsp;in&nbsp;the&nbsp;error.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_response:&nbsp;The&nbsp;response&nbsp;from&nbsp;the&nbsp;server,&nbsp;contains&nbsp;error&nbsp;information.<br>
&nbsp;&nbsp;response_body:&nbsp;string&nbsp;(optional)&nbsp;specified&nbsp;if&nbsp;the&nbsp;response&nbsp;has&nbsp;already<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;been&nbsp;read&nbsp;from&nbsp;the&nbsp;http_response&nbsp;<a href="__builtin__.html#object">object</a>.</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__str__"><strong>__str__</strong></a>(self)</dt></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#OAuth2RevokeError-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="OAuth2RevokeError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="OAuth2RevokeError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#OAuth2RevokeError-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="OAuth2RevokeError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="OAuth2RevokeError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>

<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2Token">class <strong>OAuth2Token</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;for&nbsp;OAuth&nbsp;2.0&nbsp;as&nbsp;described&nbsp;on<br>
&lt;<a href="http://code.google.com/apis/accounts/docs/OAuth2.html">http://code.google.com/apis/accounts/docs/OAuth2.html</a>&gt;.<br>
&nbsp;<br>
Token&nbsp;can&nbsp;be&nbsp;applied&nbsp;to&nbsp;a&nbsp;gdata.client.GDClient&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;using&nbsp;the&nbsp;<a href="#OAuth2Token-authorize">authorize</a>()<br>
method,&nbsp;which&nbsp;then&nbsp;signs&nbsp;each&nbsp;request&nbsp;from&nbsp;that&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;the&nbsp;OAuth&nbsp;2.0<br>
access&nbsp;token.<br>
This&nbsp;class&nbsp;supports&nbsp;3&nbsp;flows&nbsp;of&nbsp;OAuth&nbsp;2.0:<br>
&nbsp;&nbsp;Client-side&nbsp;web&nbsp;flow:&nbsp;call&nbsp;generate_authorize_url&nbsp;with&nbsp;`response_type='token''<br>
&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;the&nbsp;registered&nbsp;`redirect_uri'.<br>
&nbsp;&nbsp;Server-side&nbsp;web&nbsp;flow:&nbsp;call&nbsp;generate_authorize_url&nbsp;with&nbsp;the&nbsp;registered<br>
&nbsp;&nbsp;&nbsp;&nbsp;`redirect_url'.<br>
&nbsp;&nbsp;Native&nbsp;applications&nbsp;flow:&nbsp;call&nbsp;generate_authorize_url&nbsp;as&nbsp;it&nbsp;is.&nbsp;You&nbsp;will&nbsp;have<br>
&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;ask&nbsp;the&nbsp;user&nbsp;to&nbsp;go&nbsp;to&nbsp;the&nbsp;generated&nbsp;url&nbsp;and&nbsp;pass&nbsp;in&nbsp;the&nbsp;authorization<br>
&nbsp;&nbsp;&nbsp;&nbsp;code&nbsp;to&nbsp;your&nbsp;application.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="OAuth2Token-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#OAuth2Token-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="OAuth2Token-__init__"><strong>__init__</strong></a>(self, client_id, client_secret, scope, user_agent, auth_uri<font color="#909090">='https://accounts.google.com/o/oauth2/auth'</font>, token_uri<font color="#909090">='https://accounts.google.com/o/oauth2/token'</font>, access_token<font color="#909090">=None</font>, refresh_token<font color="#909090">=None</font>, revoke_uri<font color="#909090">='https://accounts.google.com/o/oauth2/revoke'</font>)</dt><dd><tt>Create&nbsp;an&nbsp;instance&nbsp;of&nbsp;<a href="#OAuth2Token">OAuth2Token</a><br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;client_id:&nbsp;string,&nbsp;client&nbsp;identifier.<br>
&nbsp;&nbsp;client_secret:&nbsp;string&nbsp;client&nbsp;secret.<br>
&nbsp;&nbsp;scope:&nbsp;string,&nbsp;scope&nbsp;of&nbsp;the&nbsp;credentials&nbsp;being&nbsp;requested.<br>
&nbsp;&nbsp;user_agent:&nbsp;string,&nbsp;HTTP&nbsp;User-Agent&nbsp;to&nbsp;provide&nbsp;for&nbsp;this&nbsp;application.<br>
&nbsp;&nbsp;auth_uri:&nbsp;string,&nbsp;URI&nbsp;for&nbsp;authorization&nbsp;endpoint.&nbsp;For&nbsp;convenience<br>
&nbsp;&nbsp;&nbsp;&nbsp;defaults&nbsp;to&nbsp;Google's&nbsp;endpoints&nbsp;but&nbsp;any&nbsp;OAuth&nbsp;2.0&nbsp;provider&nbsp;can&nbsp;be&nbsp;used.<br>
&nbsp;&nbsp;token_uri:&nbsp;string,&nbsp;URI&nbsp;for&nbsp;token&nbsp;endpoint.&nbsp;For&nbsp;convenience<br>
&nbsp;&nbsp;&nbsp;&nbsp;defaults&nbsp;to&nbsp;Google's&nbsp;endpoints&nbsp;but&nbsp;any&nbsp;OAuth&nbsp;2.0&nbsp;provider&nbsp;can&nbsp;be&nbsp;used.<br>
&nbsp;&nbsp;revoke_uri:&nbsp;string,&nbsp;URI&nbsp;for&nbsp;revoke&nbsp;endpoint.&nbsp;For&nbsp;convenience<br>
&nbsp;&nbsp;&nbsp;&nbsp;defaults&nbsp;to&nbsp;Google's&nbsp;endpoints&nbsp;but&nbsp;any&nbsp;OAuth&nbsp;2.0&nbsp;provider&nbsp;can&nbsp;be&nbsp;used.<br>
&nbsp;&nbsp;access_token:&nbsp;string,&nbsp;access&nbsp;token.<br>
&nbsp;&nbsp;refresh_token:&nbsp;string,&nbsp;refresh&nbsp;token.</tt></dd></dl>

<dl><dt><a name="OAuth2Token-authorize"><strong>authorize</strong></a>(self, client)</dt><dd><tt>Authorize&nbsp;a&nbsp;gdata.client.GDClient&nbsp;instance&nbsp;with&nbsp;these&nbsp;credentials.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;client:&nbsp;An&nbsp;instance&nbsp;of&nbsp;gdata.client.GDClient<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;something&nbsp;that&nbsp;acts&nbsp;like&nbsp;it.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;A&nbsp;modified&nbsp;instance&nbsp;of&nbsp;client&nbsp;that&nbsp;was&nbsp;passed&nbsp;in.<br>
&nbsp;<br>
Example:<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;c&nbsp;=&nbsp;gdata.client.GDClient(source='user-agent')<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;c&nbsp;=&nbsp;token.<a href="#OAuth2Token-authorize">authorize</a>(c)</tt></dd></dl>

<dl><dt><a name="OAuth2Token-generate_authorize_url"><strong>generate_authorize_url</strong></a>(self, redirect_uri<font color="#909090">='urn:ietf:wg:oauth:2.0:oob'</font>, response_type<font color="#909090">='code'</font>, access_type<font color="#909090">='offline'</font>, approval_prompt<font color="#909090">='auto'</font>, **kwargs)</dt><dd><tt>Returns&nbsp;a&nbsp;URI&nbsp;to&nbsp;redirect&nbsp;to&nbsp;the&nbsp;provider.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;redirect_uri:&nbsp;Either&nbsp;the&nbsp;string&nbsp;'urn:ietf:wg:oauth:2.0:oob'&nbsp;for&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;non-web-based&nbsp;application,&nbsp;or&nbsp;a&nbsp;URI&nbsp;that&nbsp;handles&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callback&nbsp;from&nbsp;the&nbsp;authorization&nbsp;server.<br>
&nbsp;&nbsp;response_type:&nbsp;Either&nbsp;the&nbsp;string&nbsp;'code'&nbsp;for&nbsp;server-side&nbsp;or&nbsp;native<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;application,&nbsp;or&nbsp;the&nbsp;string&nbsp;'token'&nbsp;for&nbsp;client-side<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;application.<br>
&nbsp;&nbsp;access_type:&nbsp;Either&nbsp;the&nbsp;string&nbsp;'offline'&nbsp;to&nbsp;request&nbsp;a&nbsp;refresh&nbsp;token&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'online'.<br>
&nbsp;&nbsp;approval_prompt:&nbsp;Either&nbsp;the&nbsp;string&nbsp;'auto'&nbsp;to&nbsp;let&nbsp;the&nbsp;OAuth&nbsp;mechanism<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;determine&nbsp;if&nbsp;the&nbsp;approval&nbsp;page&nbsp;is&nbsp;needed&nbsp;or&nbsp;'force'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;the&nbsp;approval&nbsp;prompt&nbsp;is&nbsp;desired&nbsp;in&nbsp;all&nbsp;cases.<br>
&nbsp;<br>
If&nbsp;redirect_uri&nbsp;is&nbsp;'urn:ietf:wg:oauth:2.0:oob'&nbsp;then&nbsp;pass&nbsp;in&nbsp;the<br>
generated&nbsp;verification&nbsp;code&nbsp;to&nbsp;get_access_token,<br>
otherwise&nbsp;pass&nbsp;in&nbsp;the&nbsp;query&nbsp;parameters&nbsp;received<br>
at&nbsp;the&nbsp;callback&nbsp;uri&nbsp;to&nbsp;get_access_token.<br>
If&nbsp;the&nbsp;response_type&nbsp;is&nbsp;'token',&nbsp;no&nbsp;need&nbsp;to&nbsp;call<br>
get_access_token&nbsp;as&nbsp;the&nbsp;API&nbsp;will&nbsp;return&nbsp;it&nbsp;within<br>
the&nbsp;query&nbsp;parameters&nbsp;received&nbsp;at&nbsp;the&nbsp;callback:<br>
&nbsp;&nbsp;oauth2_token.access_token&nbsp;=&nbsp;YOUR_ACCESS_TOKEN</tt></dd></dl>

<dl><dt><a name="OAuth2Token-get_access_token"><strong>get_access_token</strong></a>(self, code)</dt><dd><tt>Exhanges&nbsp;a&nbsp;code&nbsp;for&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;code:&nbsp;string&nbsp;or&nbsp;dict,&nbsp;either&nbsp;the&nbsp;code&nbsp;as&nbsp;a&nbsp;string,&nbsp;or&nbsp;a&nbsp;dictionary<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;query&nbsp;parameters&nbsp;to&nbsp;the&nbsp;redirect_uri,&nbsp;which&nbsp;contains<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;code.</tt></dd></dl>

<dl><dt><a name="OAuth2Token-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<dl><dt><a name="OAuth2Token-revoke"><strong>revoke</strong></a>(self, revoke_uri<font color="#909090">=None</font>, refresh_token<font color="#909090">=None</font>)</dt><dd><tt>Revokes&nbsp;access&nbsp;via&nbsp;a&nbsp;refresh&nbsp;token.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;revoke_uri:&nbsp;string,&nbsp;URI&nbsp;for&nbsp;revoke&nbsp;endpoint.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;or&nbsp;if<br>
&nbsp;&nbsp;&nbsp;&nbsp;None&nbsp;is&nbsp;provided,&nbsp;the&nbsp;revoke_uri&nbsp;attribute&nbsp;on&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;is&nbsp;used.<br>
&nbsp;&nbsp;refresh_token:&nbsp;string,&nbsp;refresh&nbsp;token.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;or&nbsp;if&nbsp;None&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;provided,&nbsp;the&nbsp;refresh_token&nbsp;attribute&nbsp;on&nbsp;the&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;is&nbsp;used.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;<a href="#UnsupportedTokenType">UnsupportedTokenType</a>&nbsp;if&nbsp;the&nbsp;token&nbsp;is&nbsp;not&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token<br>
&nbsp;&nbsp;classes&nbsp;listed&nbsp;above.<br>
&nbsp;<br>
Example:<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;token.<a href="#OAuth2Token-revoke">revoke</a>()</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>invalid</strong></dt>
<dd><tt>True&nbsp;if&nbsp;the&nbsp;credentials&nbsp;are&nbsp;invalid,&nbsp;such&nbsp;as&nbsp;being&nbsp;revoked.</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OAuth2TokenFromCredentials">class <strong>OAuth2TokenFromCredentials</strong></a>(<a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Special&nbsp;subclass&nbsp;to&nbsp;be&nbsp;used&nbsp;in&nbsp;conjunction&nbsp;with&nbsp;google-api-python-client.<br>
&nbsp;<br>
These&nbsp;libraries&nbsp;are&nbsp;built&nbsp;for&nbsp;different&nbsp;purposes.&nbsp;This&nbsp;one&nbsp;is&nbsp;used&nbsp;for&nbsp;APIs<br>
that&nbsp;use&nbsp;the&nbsp;GData&nbsp;Protocol:<br>
https://developers.google.com/gdata/docs/2.0/reference<br>
while&nbsp;google-api-python-client&nbsp;is&nbsp;for&nbsp;APIs&nbsp;which&nbsp;are&nbsp;discovery-based:<br>
https://developers.google.com/discovery/v1/getting_started#background<br>
&nbsp;<br>
Developers&nbsp;using&nbsp;Google&nbsp;APIs&nbsp;may&nbsp;want&nbsp;to&nbsp;use&nbsp;both&nbsp;simultaneously,&nbsp;and&nbsp;this<br>
class&nbsp;provides&nbsp;a&nbsp;way&nbsp;for&nbsp;them&nbsp;to&nbsp;use&nbsp;OAuth&nbsp;2.0&nbsp;credentials&nbsp;obtained&nbsp;for&nbsp;use<br>
with&nbsp;google-api-python-client&nbsp;as&nbsp;credentials&nbsp;in&nbsp;gdata-python-client&nbsp;and&nbsp;to<br>
ensure&nbsp;all&nbsp;token/credential&nbsp;refresh&nbsp;impacts&nbsp;both&nbsp;this&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;and&nbsp;the<br>
google-api-python-client&nbsp;credentials&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
In&nbsp;addition,&nbsp;any&nbsp;manual&nbsp;patching&nbsp;of&nbsp;this&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;or&nbsp;the&nbsp;credentials&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;will<br>
be&nbsp;immediately&nbsp;reflected&nbsp;since&nbsp;attributes&nbsp;such&nbsp;as&nbsp;`client_id`,&nbsp;`access_token`,<br>
etc.&nbsp;are&nbsp;directly&nbsp;proxied&nbsp;between&nbsp;instances&nbsp;of&nbsp;this&nbsp;class&nbsp;and&nbsp;the&nbsp;credentials<br>
objects&nbsp;that&nbsp;they&nbsp;own.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuth2TokenFromCredentials">OAuth2TokenFromCredentials</a></dd>
<dd><a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuth2TokenFromCredentials-__init__"><strong>__init__</strong></a>(self, credentials)</dt><dd><tt>Constructor&nbsp;for&nbsp;<a href="#OAuth2TokenFromCredentials">OAuth2TokenFromCredentials</a>&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
The&nbsp;constructor&nbsp;for&nbsp;the&nbsp;superclass&nbsp;is&nbsp;not&nbsp;called&nbsp;because&nbsp;the&nbsp;actual&nbsp;values<br>
are&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;credentials&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;directly&nbsp;via&nbsp;`property`&nbsp;instances<br>
which&nbsp;act&nbsp;as&nbsp;proxies.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;credentials:&nbsp;An&nbsp;instance&nbsp;of&nbsp;oauth2client.client.Credentials&nbsp;or&nbsp;some<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subclass.</tt></dd></dl>

<dl><dt><a name="OAuth2TokenFromCredentials-generate_authorize_url"><strong>generate_authorize_url</strong></a>(self, *args, **kwargs)</dt><dd><tt>#&nbsp;Disable&nbsp;methods&nbsp;not&nbsp;supported&nbsp;by&nbsp;Credentials.</tt></dd></dl>

<dl><dt><a name="OAuth2TokenFromCredentials-get_access_token"><strong>get_access_token</strong></a>(self, *args, **kwargs)</dt></dl>

<dl><dt><a name="OAuth2TokenFromCredentials-revoke"><strong>revoke</strong></a>(self, *args, **kwargs)</dt></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>access_token</strong></dt>
</dl>
<dl><dt><strong>client_id</strong></dt>
</dl>
<dl><dt><strong>client_secret</strong></dt>
</dl>
<dl><dt><strong>refresh_token</strong></dt>
</dl>
<dl><dt><strong>token_expiry</strong></dt>
</dl>
<dl><dt><strong>token_uri</strong></dt>
</dl>
<dl><dt><strong>user_agent</strong></dt>
</dl>
<hr>
Methods inherited from <a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>:<br>
<dl><dt><a name="OAuth2TokenFromCredentials-ModifyRequest"><strong>ModifyRequest</strong></a> = modify_request(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<dl><dt><a name="OAuth2TokenFromCredentials-authorize"><strong>authorize</strong></a>(self, client)</dt><dd><tt>Authorize&nbsp;a&nbsp;gdata.client.GDClient&nbsp;instance&nbsp;with&nbsp;these&nbsp;credentials.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;&nbsp;client:&nbsp;An&nbsp;instance&nbsp;of&nbsp;gdata.client.GDClient<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;something&nbsp;that&nbsp;acts&nbsp;like&nbsp;it.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;&nbsp;A&nbsp;modified&nbsp;instance&nbsp;of&nbsp;client&nbsp;that&nbsp;was&nbsp;passed&nbsp;in.<br>
&nbsp;<br>
Example:<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;c&nbsp;=&nbsp;gdata.client.GDClient(source='user-agent')<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;c&nbsp;=&nbsp;token.<a href="#OAuth2TokenFromCredentials-authorize">authorize</a>(c)</tt></dd></dl>

<dl><dt><a name="OAuth2TokenFromCredentials-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuth2Token">OAuth2Token</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>invalid</strong></dt>
<dd><tt>True&nbsp;if&nbsp;the&nbsp;credentials&nbsp;are&nbsp;invalid,&nbsp;such&nbsp;as&nbsp;being&nbsp;revoked.</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OAuthHmacToken">class <strong>OAuthHmacToken</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="OAuthHmacToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = <a href="#OAuthHmacToken-generate_authorization_url">generate_authorization_url</a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt></dl>

<dl><dt><a name="OAuthHmacToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#OAuthHmacToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="OAuthHmacToken-__init__"><strong>__init__</strong></a>(self, consumer_key, consumer_secret, token, token_secret, auth_state, next<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="OAuthHmacToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<dl><dt><a name="OAuthHmacToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Calculates&nbsp;an&nbsp;HMAC&nbsp;signature&nbsp;using&nbsp;the&nbsp;information&nbsp;in&nbsp;the&nbsp;token&nbsp;to<br>
indicate&nbsp;that&nbsp;the&nbsp;request&nbsp;came&nbsp;from&nbsp;this&nbsp;application&nbsp;and&nbsp;that&nbsp;this<br>
application&nbsp;has&nbsp;permission&nbsp;to&nbsp;access&nbsp;a&nbsp;particular&nbsp;user's&nbsp;data.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'HMAC-SHA1'</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="OAuthRsaToken">class <strong>OAuthRsaToken</strong></a>(<a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="OAuthRsaToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#OAuthRsaToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="OAuthRsaToken-__init__"><strong>__init__</strong></a>(self, consumer_key, rsa_private_key, token, token_secret, auth_state, next<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="OAuthRsaToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Calculates&nbsp;an&nbsp;RSA&nbsp;signature&nbsp;using&nbsp;the&nbsp;information&nbsp;in&nbsp;the&nbsp;token&nbsp;to<br>
indicate&nbsp;that&nbsp;the&nbsp;request&nbsp;came&nbsp;from&nbsp;this&nbsp;application&nbsp;and&nbsp;that&nbsp;this<br>
application&nbsp;has&nbsp;permission&nbsp;to&nbsp;access&nbsp;a&nbsp;particular&nbsp;user's&nbsp;data.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'RSA-SHA1'</dl>

<hr>
Methods inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><a name="OAuthRsaToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = generate_authorization_url(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<dl><dt><a name="OAuthRsaToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="SecureAuthSubToken">class <strong>SecureAuthSubToken</strong></a>(<a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#SecureAuthSubToken">SecureAuthSubToken</a></dd>
<dd><a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="SecureAuthSubToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#SecureAuthSubToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="SecureAuthSubToken-__init__"><strong>__init__</strong></a>(self, token_string, rsa_private_key, scopes<font color="#909090">=None</font>)</dt></dl>

<dl><dt><a name="SecureAuthSubToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;and&nbsp;includes&nbsp;a&nbsp;digital&nbsp;signature.<br>
&nbsp;<br>
Calculates&nbsp;a&nbsp;digital&nbsp;signature&nbsp;using&nbsp;the&nbsp;private&nbsp;RSA&nbsp;key,&nbsp;a&nbsp;timestamp<br>
(uses&nbsp;now&nbsp;at&nbsp;the&nbsp;time&nbsp;this&nbsp;method&nbsp;is&nbsp;called)&nbsp;and&nbsp;a&nbsp;random&nbsp;nonce.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_request:&nbsp;The&nbsp;atom.http_core.HttpRequest&nbsp;which&nbsp;contains&nbsp;all&nbsp;of&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;information&nbsp;needed&nbsp;to&nbsp;send&nbsp;a&nbsp;request&nbsp;to&nbsp;the&nbsp;remote&nbsp;server.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL&nbsp;and&nbsp;the&nbsp;method&nbsp;of&nbsp;the&nbsp;request&nbsp;must&nbsp;be&nbsp;already&nbsp;set&nbsp;and&nbsp;cannot&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changed&nbsp;after&nbsp;this&nbsp;token&nbsp;signs&nbsp;the&nbsp;request,&nbsp;or&nbsp;the&nbsp;signature&nbsp;will<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not&nbsp;be&nbsp;valid.</tt></dd></dl>

<hr>
Static methods defined here:<br>
<dl><dt><a name="SecureAuthSubToken-FromUrl"><strong>FromUrl</strong></a> = from_url(str_or_uri, rsa_private_key)</dt><dd><tt>Creates&nbsp;a&nbsp;new&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>&nbsp;using&nbsp;information&nbsp;in&nbsp;the&nbsp;URL.<br>
&nbsp;<br>
Uses&nbsp;auth_sub_string_from_url.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;str_or_uri:&nbsp;The&nbsp;current&nbsp;page's&nbsp;URL&nbsp;(as&nbsp;a&nbsp;str&nbsp;or&nbsp;atom.http_core.Uri)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;should&nbsp;contain&nbsp;a&nbsp;token&nbsp;query&nbsp;parameter&nbsp;since&nbsp;the&nbsp;Google&nbsp;auth<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server&nbsp;redirected&nbsp;the&nbsp;user's&nbsp;browser&nbsp;to&nbsp;this&nbsp;URL.<br>
&nbsp;&nbsp;rsa_private_key:&nbsp;str&nbsp;the&nbsp;private&nbsp;RSA&nbsp;key&nbsp;cert&nbsp;used&nbsp;to&nbsp;sign&nbsp;all&nbsp;requests<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;made&nbsp;with&nbsp;this&nbsp;token.</tt></dd></dl>

<dl><dt><a name="SecureAuthSubToken-from_url"><strong>from_url</strong></a>(str_or_uri, rsa_private_key)</dt><dd><tt>Creates&nbsp;a&nbsp;new&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>&nbsp;using&nbsp;information&nbsp;in&nbsp;the&nbsp;URL.<br>
&nbsp;<br>
Uses&nbsp;auth_sub_string_from_url.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;str_or_uri:&nbsp;The&nbsp;current&nbsp;page's&nbsp;URL&nbsp;(as&nbsp;a&nbsp;str&nbsp;or&nbsp;atom.http_core.Uri)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;should&nbsp;contain&nbsp;a&nbsp;token&nbsp;query&nbsp;parameter&nbsp;since&nbsp;the&nbsp;Google&nbsp;auth<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;server&nbsp;redirected&nbsp;the&nbsp;user's&nbsp;browser&nbsp;to&nbsp;this&nbsp;URL.<br>
&nbsp;&nbsp;rsa_private_key:&nbsp;str&nbsp;the&nbsp;private&nbsp;RSA&nbsp;key&nbsp;cert&nbsp;used&nbsp;to&nbsp;sign&nbsp;all&nbsp;requests<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;made&nbsp;with&nbsp;this&nbsp;token.</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#AuthSubToken">AuthSubToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="TwoLeggedOAuthHmacToken">class <strong>TwoLeggedOAuthHmacToken</strong></a>(<a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="TwoLeggedOAuthHmacToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#TwoLeggedOAuthHmacToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="TwoLeggedOAuthHmacToken-__init__"><strong>__init__</strong></a>(self, consumer_key, consumer_secret, requestor_id)</dt></dl>

<dl><dt><a name="TwoLeggedOAuthHmacToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Calculates&nbsp;an&nbsp;HMAC&nbsp;signature&nbsp;using&nbsp;the&nbsp;information&nbsp;in&nbsp;the&nbsp;token&nbsp;to<br>
indicate&nbsp;that&nbsp;the&nbsp;request&nbsp;came&nbsp;from&nbsp;this&nbsp;application&nbsp;and&nbsp;that&nbsp;this<br>
application&nbsp;has&nbsp;permission&nbsp;to&nbsp;access&nbsp;a&nbsp;particular&nbsp;user's&nbsp;data&nbsp;using&nbsp;2LO.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<hr>
Methods inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><a name="TwoLeggedOAuthHmacToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = generate_authorization_url(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<dl><dt><a name="TwoLeggedOAuthHmacToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Data and other attributes inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'HMAC-SHA1'</dl>

</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="TwoLeggedOAuthRsaToken">class <strong>TwoLeggedOAuthRsaToken</strong></a>(<a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a>)</font></td></tr>
    
<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a></dd>
<dd><a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="TwoLeggedOAuthRsaToken-ModifyRequest"><strong>ModifyRequest</strong></a> = <a href="#TwoLeggedOAuthRsaToken-modify_request">modify_request</a>(self, http_request)</dt></dl>

<dl><dt><a name="TwoLeggedOAuthRsaToken-__init__"><strong>__init__</strong></a>(self, consumer_key, rsa_private_key, requestor_id)</dt></dl>

<dl><dt><a name="TwoLeggedOAuthRsaToken-modify_request"><strong>modify_request</strong></a>(self, http_request)</dt><dd><tt>Sets&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;in&nbsp;the&nbsp;HTTP&nbsp;request&nbsp;using&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Calculates&nbsp;an&nbsp;RSA&nbsp;signature&nbsp;using&nbsp;the&nbsp;information&nbsp;in&nbsp;the&nbsp;token&nbsp;to<br>
indicate&nbsp;that&nbsp;the&nbsp;request&nbsp;came&nbsp;from&nbsp;this&nbsp;application&nbsp;and&nbsp;that&nbsp;this<br>
application&nbsp;has&nbsp;permission&nbsp;to&nbsp;access&nbsp;a&nbsp;particular&nbsp;user's&nbsp;data&nbsp;using&nbsp;2LO.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;HTTP&nbsp;request&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="gdata.gauth.html#OAuthRsaToken">OAuthRsaToken</a>:<br>
<dl><dt><strong>SIGNATURE_METHOD</strong> = 'RSA-SHA1'</dl>

<hr>
Methods inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><a name="TwoLeggedOAuthRsaToken-GenerateAuthorizationUrl"><strong>GenerateAuthorizationUrl</strong></a> = generate_authorization_url(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<dl><dt><a name="TwoLeggedOAuthRsaToken-generate_authorization_url"><strong>generate_authorization_url</strong></a>(self, google_apps_domain<font color="#909090">='default'</font>, language<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;user&nbsp;can&nbsp;authorize&nbsp;this&nbsp;app&nbsp;to&nbsp;access.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;google_apps_domain:&nbsp;str&nbsp;(optional)&nbsp;If&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;signing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;an&nbsp;account&nbsp;under&nbsp;a&nbsp;known&nbsp;Google&nbsp;Apps&nbsp;domain,&nbsp;provide&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;domain&nbsp;name&nbsp;('example.com')&nbsp;here.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;'default'<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;used,&nbsp;and&nbsp;the&nbsp;user&nbsp;will&nbsp;be&nbsp;prompted&nbsp;to&nbsp;select&nbsp;an&nbsp;account<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;they&nbsp;are&nbsp;signed&nbsp;in&nbsp;with&nbsp;a&nbsp;Google&nbsp;Account&nbsp;and&nbsp;Google&nbsp;Apps<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accounts.<br>
&nbsp;&nbsp;language:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;language&nbsp;the&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'en'&nbsp;for&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'</tt></dd></dl>

<hr>
Data descriptors inherited from <a href="gdata.gauth.html#OAuthHmacToken">OAuthHmacToken</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#000000" face="helvetica, arial"><a name="UnsupportedTokenType">class <strong>UnsupportedTokenType</strong></a>(<a href="gdata.gauth.html#Error">Error</a>)</font></td></tr>
    
<tr bgcolor="#ffc8d8"><td rowspan=2><tt>&nbsp;&nbsp;&nbsp;</tt></td>
<td colspan=2><tt>Raised&nbsp;when&nbsp;token&nbsp;to&nbsp;or&nbsp;from&nbsp;blob&nbsp;is&nbsp;unable&nbsp;to&nbsp;convert&nbsp;the&nbsp;token.<br>&nbsp;</tt></td></tr>
<tr><td>&nbsp;</td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="gdata.gauth.html#UnsupportedTokenType">UnsupportedTokenType</a></dd>
<dd><a href="gdata.gauth.html#Error">Error</a></dd>
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Data descriptors inherited from <a href="gdata.gauth.html#Error">Error</a>:<br>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
</dl>
<hr>
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><a name="UnsupportedTokenType-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__init__">__init__</a>(...)&nbsp;initializes&nbsp;x;&nbsp;see&nbsp;help(type(x))&nbsp;for&nbsp;signature</tt></dd></dl>

<hr>
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
<dl><dt><strong>__new__</strong> = &lt;built-in method __new__ of type object&gt;<dd><tt>T.<a href="#UnsupportedTokenType-__new__">__new__</a>(S,&nbsp;...)&nbsp;-&gt;&nbsp;a&nbsp;new&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;type&nbsp;S,&nbsp;a&nbsp;subtype&nbsp;of&nbsp;T</tt></dl>

<hr>
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><a name="UnsupportedTokenType-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__delattr__">__delattr__</a>('name')&nbsp;&lt;==&gt;&nbsp;del&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__getattribute__">__getattribute__</a>('name')&nbsp;&lt;==&gt;&nbsp;x.name</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__getitem__">__getitem__</a>(y)&nbsp;&lt;==&gt;&nbsp;x[y]</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__getslice__">__getslice__</a>(i,&nbsp;j)&nbsp;&lt;==&gt;&nbsp;x[i:j]<br>
&nbsp;<br>
Use&nbsp;of&nbsp;negative&nbsp;indices&nbsp;is&nbsp;not&nbsp;supported.</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>

<dl><dt><a name="UnsupportedTokenType-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__repr__">__repr__</a>()&nbsp;&lt;==&gt;&nbsp;repr(x)</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__setattr__">__setattr__</a>('name',&nbsp;value)&nbsp;&lt;==&gt;&nbsp;x.name&nbsp;=&nbsp;value</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>

<dl><dt><a name="UnsupportedTokenType-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#UnsupportedTokenType-__str__">__str__</a>()&nbsp;&lt;==&gt;&nbsp;str(x)</tt></dd></dl>

<dl><dt><a name="UnsupportedTokenType-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>

<hr>
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
<dl><dt><strong>__dict__</strong></dt>
</dl>
<dl><dt><strong>args</strong></dt>
</dl>
<dl><dt><strong>message</strong></dt>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-AeDelete"><strong>AeDelete</strong></a> = ae_delete(token_key)</dt><dd><tt>Removes&nbsp;the&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.</tt></dd></dl>
 <dl><dt><a name="-AeLoad"><strong>AeLoad</strong></a> = ae_load(token_key)</dt><dd><tt>Retrieves&nbsp;a&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;method&nbsp;for&nbsp;using&nbsp;the&nbsp;library&nbsp;with&nbsp;App&nbsp;Engine.<br>
See&nbsp;also&nbsp;ae_save.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token_key:&nbsp;str&nbsp;The&nbsp;unique&nbsp;key&nbsp;associated&nbsp;with&nbsp;the&nbsp;desired&nbsp;token&nbsp;when&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;was&nbsp;saved&nbsp;using&nbsp;ae_save.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;if&nbsp;there&nbsp;was&nbsp;a&nbsp;token&nbsp;associated&nbsp;with&nbsp;the&nbsp;token_key&nbsp;or&nbsp;None<br>
&nbsp;&nbsp;if&nbsp;the&nbsp;key&nbsp;could&nbsp;not&nbsp;be&nbsp;found.</tt></dd></dl>
 <dl><dt><a name="-AeSave"><strong>AeSave</strong></a> = ae_save(token, token_key)</dt><dd><tt>Stores&nbsp;an&nbsp;auth&nbsp;token&nbsp;in&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;method&nbsp;for&nbsp;using&nbsp;the&nbsp;library&nbsp;with&nbsp;App&nbsp;Engine.<br>
Recommended&nbsp;usage&nbsp;is&nbsp;to&nbsp;associate&nbsp;the&nbsp;auth&nbsp;token&nbsp;with&nbsp;the&nbsp;current_user.<br>
If&nbsp;a&nbsp;user&nbsp;is&nbsp;signed&nbsp;in&nbsp;to&nbsp;the&nbsp;app&nbsp;using&nbsp;the&nbsp;App&nbsp;Engine&nbsp;users&nbsp;API,&nbsp;you<br>
can&nbsp;use<br>
gdata.gauth.<a href="#-ae_save">ae_save</a>(some_token,&nbsp;users.get_current_user().user_id())<br>
If&nbsp;you&nbsp;are&nbsp;not&nbsp;using&nbsp;the&nbsp;Users&nbsp;API&nbsp;you&nbsp;are&nbsp;free&nbsp;to&nbsp;choose&nbsp;whatever<br>
string&nbsp;you&nbsp;would&nbsp;like&nbsp;for&nbsp;a&nbsp;token_string.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token:&nbsp;an&nbsp;auth&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>.&nbsp;Must&nbsp;be&nbsp;one&nbsp;of&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#AuthSubToken">AuthSubToken</a>,&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>,&nbsp;<a href="#OAuthRsaToken">OAuthRsaToken</a>,&nbsp;or&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(see&nbsp;token_to_blob).<br>
&nbsp;&nbsp;token_key:&nbsp;str&nbsp;A&nbsp;unique&nbsp;identified&nbsp;to&nbsp;be&nbsp;used&nbsp;when&nbsp;you&nbsp;want&nbsp;to&nbsp;retrieve<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;token.&nbsp;If&nbsp;the&nbsp;user&nbsp;is&nbsp;signed&nbsp;in&nbsp;to&nbsp;App&nbsp;Engine&nbsp;using&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;users&nbsp;API,&nbsp;I&nbsp;recommend&nbsp;using&nbsp;the&nbsp;user&nbsp;ID&nbsp;for&nbsp;the&nbsp;token_key:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;users.get_current_user().user_id()</tt></dd></dl>
 <dl><dt><a name="-AuthSubStringFromUrl"><strong>AuthSubStringFromUrl</strong></a> = auth_sub_string_from_url(url, scopes_param_prefix<font color="#909090">='auth_sub_scopes'</font>)</dt><dd><tt>Finds&nbsp;the&nbsp;token&nbsp;string&nbsp;(and&nbsp;scopes)&nbsp;after&nbsp;the&nbsp;browser&nbsp;is&nbsp;redirected.<br>
&nbsp;<br>
After&nbsp;the&nbsp;Google&nbsp;Accounts&nbsp;AuthSub&nbsp;pages&nbsp;redirect&nbsp;the&nbsp;user's&nbsp;broswer&nbsp;back&nbsp;to<br>
the&nbsp;web&nbsp;application&nbsp;(using&nbsp;the&nbsp;'next'&nbsp;URL&nbsp;from&nbsp;the&nbsp;request)&nbsp;the&nbsp;web&nbsp;app&nbsp;must<br>
extract&nbsp;the&nbsp;token&nbsp;from&nbsp;the&nbsp;current&nbsp;page's&nbsp;URL.&nbsp;The&nbsp;token&nbsp;is&nbsp;provided&nbsp;as&nbsp;a<br>
URL&nbsp;parameter&nbsp;named&nbsp;'token'&nbsp;and&nbsp;if&nbsp;generate_auth_sub_url&nbsp;was&nbsp;used&nbsp;to&nbsp;create<br>
the&nbsp;request,&nbsp;the&nbsp;token's&nbsp;valid&nbsp;scopes&nbsp;are&nbsp;included&nbsp;in&nbsp;a&nbsp;URL&nbsp;parameter&nbsp;whose<br>
name&nbsp;is&nbsp;specified&nbsp;in&nbsp;scopes_param_prefix.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;url:&nbsp;atom.url.Url&nbsp;or&nbsp;str&nbsp;representing&nbsp;the&nbsp;current&nbsp;URL.&nbsp;The&nbsp;token&nbsp;value<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;valid&nbsp;scopes&nbsp;should&nbsp;be&nbsp;included&nbsp;as&nbsp;URL&nbsp;parameters.<br>
&nbsp;&nbsp;scopes_param_prefix:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;URL&nbsp;parameter&nbsp;key&nbsp;which&nbsp;maps&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;list&nbsp;of&nbsp;valid&nbsp;scopes&nbsp;for&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;containing&nbsp;the&nbsp;token&nbsp;value&nbsp;as&nbsp;a&nbsp;string,&nbsp;and&nbsp;a&nbsp;tuple&nbsp;of&nbsp;scopes<br>
&nbsp;&nbsp;(as&nbsp;atom.http_core.Uri&nbsp;objects)&nbsp;which&nbsp;are&nbsp;URL&nbsp;prefixes&nbsp;under&nbsp;which&nbsp;this<br>
&nbsp;&nbsp;token&nbsp;grants&nbsp;permission&nbsp;to&nbsp;read&nbsp;and&nbsp;write&nbsp;user&nbsp;data.<br>
&nbsp;&nbsp;(token_string,&nbsp;(scope_uri,&nbsp;scope_uri,&nbsp;scope_uri,&nbsp;...))<br>
&nbsp;&nbsp;If&nbsp;no&nbsp;scopes&nbsp;were&nbsp;included&nbsp;in&nbsp;the&nbsp;URL,&nbsp;the&nbsp;second&nbsp;value&nbsp;in&nbsp;the&nbsp;tuple&nbsp;is<br>
&nbsp;&nbsp;None.&nbsp;If&nbsp;there&nbsp;was&nbsp;no&nbsp;token&nbsp;param&nbsp;in&nbsp;the&nbsp;url,&nbsp;the&nbsp;tuple&nbsp;returned&nbsp;is<br>
&nbsp;&nbsp;(None,&nbsp;None)</tt></dd></dl>
 <dl><dt><a name="-AuthorizeRequestToken"><strong>AuthorizeRequestToken</strong></a> = authorize_request_token(request_token, url)</dt><dd><tt>Adds&nbsp;information&nbsp;to&nbsp;request&nbsp;token&nbsp;to&nbsp;allow&nbsp;it&nbsp;to&nbsp;become&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;<br>
Modifies&nbsp;the&nbsp;request_token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;passed&nbsp;in&nbsp;by&nbsp;setting&nbsp;and&nbsp;unsetting&nbsp;the<br>
necessary&nbsp;fields&nbsp;to&nbsp;allow&nbsp;this&nbsp;token&nbsp;to&nbsp;form&nbsp;a&nbsp;valid&nbsp;upgrade&nbsp;request.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;request_token:&nbsp;The&nbsp;OAuth&nbsp;request&nbsp;token&nbsp;which&nbsp;has&nbsp;been&nbsp;authorized&nbsp;by&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.&nbsp;In&nbsp;order&nbsp;for&nbsp;this&nbsp;token&nbsp;to&nbsp;be&nbsp;upgraded&nbsp;to&nbsp;an&nbsp;access&nbsp;token,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;certain&nbsp;fields&nbsp;must&nbsp;be&nbsp;extracted&nbsp;from&nbsp;the&nbsp;URL&nbsp;and&nbsp;added&nbsp;to&nbsp;the&nbsp;token<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;so&nbsp;that&nbsp;they&nbsp;can&nbsp;be&nbsp;passed&nbsp;in&nbsp;an&nbsp;upgrade-token&nbsp;request.<br>
&nbsp;&nbsp;url:&nbsp;The&nbsp;URL&nbsp;of&nbsp;the&nbsp;current&nbsp;page&nbsp;which&nbsp;the&nbsp;user's&nbsp;browser&nbsp;was&nbsp;redirected<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;after&nbsp;they&nbsp;authorized&nbsp;access&nbsp;for&nbsp;the&nbsp;app.&nbsp;This&nbsp;function&nbsp;extracts<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;information&nbsp;from&nbsp;the&nbsp;URL&nbsp;which&nbsp;is&nbsp;needed&nbsp;to&nbsp;upgraded&nbsp;the&nbsp;token&nbsp;from<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;request&nbsp;token&nbsp;to&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>
 <dl><dt><a name="-FindScopesForServices"><strong>FindScopesForServices</strong></a> = find_scopes_for_services(service_names<font color="#909090">=None</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;combined&nbsp;list&nbsp;of&nbsp;scope&nbsp;URLs&nbsp;for&nbsp;the&nbsp;desired&nbsp;services.<br>
&nbsp;<br>
This&nbsp;method&nbsp;searches&nbsp;the&nbsp;AUTH_SCOPES&nbsp;dictionary.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;service_names:&nbsp;list&nbsp;of&nbsp;strings&nbsp;(optional)&nbsp;Each&nbsp;name&nbsp;must&nbsp;be&nbsp;a&nbsp;key&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AUTH_SCOPES&nbsp;dictionary.&nbsp;If&nbsp;no&nbsp;list&nbsp;is&nbsp;provided&nbsp;(None)&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;resulting&nbsp;list&nbsp;will&nbsp;contain&nbsp;all&nbsp;scope&nbsp;URLs&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AUTH_SCOPES&nbsp;dict.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;URL&nbsp;strings&nbsp;which&nbsp;are&nbsp;the&nbsp;scopes&nbsp;needed&nbsp;to&nbsp;access&nbsp;these&nbsp;services<br>
&nbsp;&nbsp;when&nbsp;requesting&nbsp;a&nbsp;token&nbsp;using&nbsp;AuthSub&nbsp;or&nbsp;OAuth.</tt></dd></dl>
 <dl><dt><a name="-GenerateClientLoginRequestBody"><strong>GenerateClientLoginRequestBody</strong></a> = generate_client_login_request_body(email, password, service, source, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;autentication&nbsp;request<br>
&nbsp;<br>
See&nbsp;<a href="http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request">http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request</a><br>
for&nbsp;more&nbsp;details.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;email:&nbsp;str<br>
&nbsp;&nbsp;password:&nbsp;str<br>
&nbsp;&nbsp;service:&nbsp;str<br>
&nbsp;&nbsp;source:&nbsp;str<br>
&nbsp;&nbsp;account_type:&nbsp;str&nbsp;(optional)&nbsp;Defaul&nbsp;is&nbsp;'HOSTED_OR_GOOGLE',&nbsp;other&nbsp;valid<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values&nbsp;are&nbsp;'GOOGLE'&nbsp;and&nbsp;'HOSTED'<br>
&nbsp;&nbsp;captcha_token:&nbsp;str&nbsp;(optional)<br>
&nbsp;&nbsp;captcha_response:&nbsp;str&nbsp;(optional)<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;HTTP&nbsp;body&nbsp;to&nbsp;send&nbsp;in&nbsp;a&nbsp;request&nbsp;for&nbsp;a&nbsp;client&nbsp;login&nbsp;token.</tt></dd></dl>
 <dl><dt><a name="-GetCaptchaChallenge"><strong>GetCaptchaChallenge</strong></a> = get_captcha_challenge(http_body, captcha_base_url<font color="#909090">='http://www.google.com/accounts/'</font>)</dt><dd><tt>Returns&nbsp;the&nbsp;URL&nbsp;and&nbsp;token&nbsp;for&nbsp;a&nbsp;CAPTCHA&nbsp;challenge&nbsp;issued&nbsp;by&nbsp;the&nbsp;server.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_body:&nbsp;str&nbsp;The&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response&nbsp;from&nbsp;the&nbsp;server&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contains&nbsp;the&nbsp;CAPTCHA&nbsp;challenge.<br>
&nbsp;&nbsp;captcha_base_url:&nbsp;str&nbsp;This&nbsp;function&nbsp;returns&nbsp;a&nbsp;full&nbsp;URL&nbsp;for&nbsp;viewing&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;challenge&nbsp;image&nbsp;which&nbsp;is&nbsp;built&nbsp;from&nbsp;the&nbsp;server's&nbsp;response.&nbsp;This<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base_url&nbsp;is&nbsp;used&nbsp;as&nbsp;the&nbsp;beginning&nbsp;of&nbsp;the&nbsp;URL&nbsp;because&nbsp;the&nbsp;server<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;provides&nbsp;the&nbsp;end&nbsp;of&nbsp;the&nbsp;URL.&nbsp;For&nbsp;example&nbsp;the&nbsp;server&nbsp;provides<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Captcha?ctoken=Hi...N'&nbsp;and&nbsp;the&nbsp;URL&nbsp;for&nbsp;the&nbsp;image&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<a href="http://www.google.com/accounts/Captcha?ctoken=Hi...N">http://www.google.com/accounts/Captcha?ctoken=Hi...N</a>'<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;dictionary&nbsp;containing&nbsp;the&nbsp;information&nbsp;needed&nbsp;to&nbsp;repond&nbsp;to&nbsp;the&nbsp;CAPTCHA<br>
&nbsp;&nbsp;challenge,&nbsp;the&nbsp;image&nbsp;URL&nbsp;and&nbsp;the&nbsp;ID&nbsp;token&nbsp;of&nbsp;the&nbsp;challenge.&nbsp;The<br>
&nbsp;&nbsp;dictionary&nbsp;is&nbsp;in&nbsp;the&nbsp;form:<br>
&nbsp;&nbsp;{'token':&nbsp;string&nbsp;identifying&nbsp;the&nbsp;CAPTCHA&nbsp;image,<br>
&nbsp;&nbsp;&nbsp;'url':&nbsp;string&nbsp;containing&nbsp;the&nbsp;URL&nbsp;of&nbsp;the&nbsp;image}<br>
&nbsp;&nbsp;Returns&nbsp;None&nbsp;if&nbsp;there&nbsp;was&nbsp;no&nbsp;CAPTCHA&nbsp;challenge&nbsp;in&nbsp;the&nbsp;response.</tt></dd></dl>
 <dl><dt><a name="-GetClientLoginTokenString"><strong>GetClientLoginTokenString</strong></a> = get_client_login_token_string(http_body)</dt><dd><tt>Returns&nbsp;the&nbsp;token&nbsp;value&nbsp;for&nbsp;a&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>.<br>
&nbsp;<br>
Reads&nbsp;the&nbsp;token&nbsp;from&nbsp;the&nbsp;server's&nbsp;response&nbsp;to&nbsp;a&nbsp;Client&nbsp;Login&nbsp;request&nbsp;and<br>
creates&nbsp;the&nbsp;token&nbsp;value&nbsp;string&nbsp;to&nbsp;use&nbsp;in&nbsp;requests.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_body:&nbsp;str&nbsp;The&nbsp;body&nbsp;of&nbsp;the&nbsp;server's&nbsp;HTTP&nbsp;response&nbsp;to&nbsp;a&nbsp;Client&nbsp;Login<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;token&nbsp;value&nbsp;string&nbsp;for&nbsp;a&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>.</tt></dd></dl>
 <dl><dt><a name="-TokenFromBlob"><strong>TokenFromBlob</strong></a> = token_from_blob(blob)</dt><dd><tt>Deserializes&nbsp;a&nbsp;token&nbsp;string&nbsp;from&nbsp;the&nbsp;datastore&nbsp;back&nbsp;into&nbsp;a&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Supported&nbsp;token&nbsp;classes:&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>,&nbsp;<a href="#AuthSubToken">AuthSubToken</a>,&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>,&nbsp;and&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a>,&nbsp;<a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a>&nbsp;and&nbsp;<a href="#OAuth2Token">OAuth2Token</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;blob:&nbsp;string&nbsp;created&nbsp;by&nbsp;token_to_blob.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;<a href="#UnsupportedTokenType">UnsupportedTokenType</a>&nbsp;if&nbsp;the&nbsp;token&nbsp;is&nbsp;not&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token<br>
&nbsp;&nbsp;classes&nbsp;listed&nbsp;above.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;new&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;members&nbsp;set&nbsp;to&nbsp;the&nbsp;values&nbsp;serialized&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;blob&nbsp;string.&nbsp;Note&nbsp;that&nbsp;any&nbsp;members&nbsp;which&nbsp;were&nbsp;set&nbsp;to&nbsp;''&nbsp;in&nbsp;the&nbsp;original<br>
&nbsp;&nbsp;token&nbsp;will&nbsp;now&nbsp;be&nbsp;None.</tt></dd></dl>
 <dl><dt><a name="-TokenToBlob"><strong>TokenToBlob</strong></a> = token_to_blob(token)</dt><dd><tt>Serializes&nbsp;the&nbsp;token&nbsp;data&nbsp;as&nbsp;a&nbsp;string&nbsp;for&nbsp;storage&nbsp;in&nbsp;a&nbsp;datastore.<br>
&nbsp;<br>
Supported&nbsp;token&nbsp;classes:&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>,&nbsp;<a href="#AuthSubToken">AuthSubToken</a>,&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>,&nbsp;and&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a>,&nbsp;<a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a>&nbsp;and&nbsp;<a href="#OAuth2Token">OAuth2Token</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token:&nbsp;A&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;must&nbsp;be&nbsp;of&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token&nbsp;classes.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;<a href="#UnsupportedTokenType">UnsupportedTokenType</a>&nbsp;if&nbsp;the&nbsp;token&nbsp;is&nbsp;not&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token<br>
&nbsp;&nbsp;classes&nbsp;listed&nbsp;above.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;string&nbsp;represenging&nbsp;this&nbsp;token.&nbsp;The&nbsp;string&nbsp;can&nbsp;be&nbsp;converted&nbsp;back&nbsp;into<br>
&nbsp;&nbsp;an&nbsp;equivalent&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;using&nbsp;token_from_blob.&nbsp;Note&nbsp;that&nbsp;any&nbsp;members<br>
&nbsp;&nbsp;which&nbsp;are&nbsp;set&nbsp;to&nbsp;''&nbsp;will&nbsp;be&nbsp;set&nbsp;to&nbsp;None&nbsp;when&nbsp;the&nbsp;token&nbsp;is&nbsp;deserialized<br>
&nbsp;&nbsp;by&nbsp;token_from_blob.</tt></dd></dl>
 <dl><dt><a name="-UpgradeToAccessToken"><strong>UpgradeToAccessToken</strong></a> = upgrade_to_access_token(request_token, server_response_body)</dt><dd><tt>Extracts&nbsp;access&nbsp;token&nbsp;information&nbsp;from&nbsp;response&nbsp;to&nbsp;an&nbsp;upgrade&nbsp;request.<br>
&nbsp;<br>
Once&nbsp;the&nbsp;server&nbsp;has&nbsp;responded&nbsp;with&nbsp;the&nbsp;new&nbsp;token&nbsp;info&nbsp;for&nbsp;the&nbsp;OAuth<br>
access&nbsp;token,&nbsp;this&nbsp;method&nbsp;modifies&nbsp;the&nbsp;request_token&nbsp;to&nbsp;set&nbsp;and&nbsp;unset<br>
necessary&nbsp;fields&nbsp;to&nbsp;create&nbsp;valid&nbsp;OAuth&nbsp;authorization&nbsp;headers&nbsp;for&nbsp;requests.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;request_token:&nbsp;An&nbsp;OAuth&nbsp;token&nbsp;which&nbsp;this&nbsp;function&nbsp;modifies&nbsp;to&nbsp;allow&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;be&nbsp;used&nbsp;as&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;&nbsp;server_response_body:&nbsp;str&nbsp;The&nbsp;server's&nbsp;response&nbsp;to&nbsp;an&nbsp;OAuthAuthorizeToken<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request.&nbsp;This&nbsp;should&nbsp;contain&nbsp;the&nbsp;new&nbsp;token&nbsp;and&nbsp;token_secret&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;used&nbsp;to&nbsp;generate&nbsp;the&nbsp;signature&nbsp;and&nbsp;parameters&nbsp;of&nbsp;the&nbsp;Authorization<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header&nbsp;in&nbsp;subsequent&nbsp;requests&nbsp;to&nbsp;Google&nbsp;Data&nbsp;APIs.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>
 <dl><dt><a name="-ae_delete"><strong>ae_delete</strong></a>(token_key)</dt><dd><tt>Removes&nbsp;the&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.</tt></dd></dl>
 <dl><dt><a name="-ae_load"><strong>ae_load</strong></a>(token_key)</dt><dd><tt>Retrieves&nbsp;a&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;from&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;method&nbsp;for&nbsp;using&nbsp;the&nbsp;library&nbsp;with&nbsp;App&nbsp;Engine.<br>
See&nbsp;also&nbsp;ae_save.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token_key:&nbsp;str&nbsp;The&nbsp;unique&nbsp;key&nbsp;associated&nbsp;with&nbsp;the&nbsp;desired&nbsp;token&nbsp;when&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;was&nbsp;saved&nbsp;using&nbsp;ae_save.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;if&nbsp;there&nbsp;was&nbsp;a&nbsp;token&nbsp;associated&nbsp;with&nbsp;the&nbsp;token_key&nbsp;or&nbsp;None<br>
&nbsp;&nbsp;if&nbsp;the&nbsp;key&nbsp;could&nbsp;not&nbsp;be&nbsp;found.</tt></dd></dl>
 <dl><dt><a name="-ae_save"><strong>ae_save</strong></a>(token, token_key)</dt><dd><tt>Stores&nbsp;an&nbsp;auth&nbsp;token&nbsp;in&nbsp;the&nbsp;App&nbsp;Engine&nbsp;datastore.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;method&nbsp;for&nbsp;using&nbsp;the&nbsp;library&nbsp;with&nbsp;App&nbsp;Engine.<br>
Recommended&nbsp;usage&nbsp;is&nbsp;to&nbsp;associate&nbsp;the&nbsp;auth&nbsp;token&nbsp;with&nbsp;the&nbsp;current_user.<br>
If&nbsp;a&nbsp;user&nbsp;is&nbsp;signed&nbsp;in&nbsp;to&nbsp;the&nbsp;app&nbsp;using&nbsp;the&nbsp;App&nbsp;Engine&nbsp;users&nbsp;API,&nbsp;you<br>
can&nbsp;use<br>
gdata.gauth.<a href="#-ae_save">ae_save</a>(some_token,&nbsp;users.get_current_user().user_id())<br>
If&nbsp;you&nbsp;are&nbsp;not&nbsp;using&nbsp;the&nbsp;Users&nbsp;API&nbsp;you&nbsp;are&nbsp;free&nbsp;to&nbsp;choose&nbsp;whatever<br>
string&nbsp;you&nbsp;would&nbsp;like&nbsp;for&nbsp;a&nbsp;token_string.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token:&nbsp;an&nbsp;auth&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>.&nbsp;Must&nbsp;be&nbsp;one&nbsp;of&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#AuthSubToken">AuthSubToken</a>,&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>,&nbsp;<a href="#OAuthRsaToken">OAuthRsaToken</a>,&nbsp;or&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(see&nbsp;token_to_blob).<br>
&nbsp;&nbsp;token_key:&nbsp;str&nbsp;A&nbsp;unique&nbsp;identified&nbsp;to&nbsp;be&nbsp;used&nbsp;when&nbsp;you&nbsp;want&nbsp;to&nbsp;retrieve<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;token.&nbsp;If&nbsp;the&nbsp;user&nbsp;is&nbsp;signed&nbsp;in&nbsp;to&nbsp;App&nbsp;Engine&nbsp;using&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;users&nbsp;API,&nbsp;I&nbsp;recommend&nbsp;using&nbsp;the&nbsp;user&nbsp;ID&nbsp;for&nbsp;the&nbsp;token_key:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;users.get_current_user().user_id()</tt></dd></dl>
 <dl><dt><a name="-auth_sub_string_from_body"><strong>auth_sub_string_from_body</strong></a>(http_body)</dt><dd><tt>Extracts&nbsp;the&nbsp;AuthSub&nbsp;token&nbsp;from&nbsp;an&nbsp;HTTP&nbsp;body&nbsp;string.<br>
&nbsp;<br>
Used&nbsp;to&nbsp;find&nbsp;the&nbsp;new&nbsp;session&nbsp;token&nbsp;after&nbsp;making&nbsp;a&nbsp;request&nbsp;to&nbsp;upgrade&nbsp;a<br>
single&nbsp;use&nbsp;AuthSub&nbsp;token.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_body:&nbsp;str&nbsp;The&nbsp;repsonse&nbsp;from&nbsp;the&nbsp;server&nbsp;which&nbsp;contains&nbsp;the&nbsp;AuthSub<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key.&nbsp;For&nbsp;example,&nbsp;this&nbsp;function&nbsp;would&nbsp;find&nbsp;the&nbsp;new&nbsp;session&nbsp;token<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;server's&nbsp;response&nbsp;to&nbsp;an&nbsp;upgrade&nbsp;token&nbsp;request.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;raw&nbsp;token&nbsp;value&nbsp;string&nbsp;to&nbsp;use&nbsp;in&nbsp;an&nbsp;<a href="#AuthSubToken">AuthSubToken</a>&nbsp;<a href="__builtin__.html#object">object</a>.</tt></dd></dl>
 <dl><dt><a name="-auth_sub_string_from_url"><strong>auth_sub_string_from_url</strong></a>(url, scopes_param_prefix<font color="#909090">='auth_sub_scopes'</font>)</dt><dd><tt>Finds&nbsp;the&nbsp;token&nbsp;string&nbsp;(and&nbsp;scopes)&nbsp;after&nbsp;the&nbsp;browser&nbsp;is&nbsp;redirected.<br>
&nbsp;<br>
After&nbsp;the&nbsp;Google&nbsp;Accounts&nbsp;AuthSub&nbsp;pages&nbsp;redirect&nbsp;the&nbsp;user's&nbsp;broswer&nbsp;back&nbsp;to<br>
the&nbsp;web&nbsp;application&nbsp;(using&nbsp;the&nbsp;'next'&nbsp;URL&nbsp;from&nbsp;the&nbsp;request)&nbsp;the&nbsp;web&nbsp;app&nbsp;must<br>
extract&nbsp;the&nbsp;token&nbsp;from&nbsp;the&nbsp;current&nbsp;page's&nbsp;URL.&nbsp;The&nbsp;token&nbsp;is&nbsp;provided&nbsp;as&nbsp;a<br>
URL&nbsp;parameter&nbsp;named&nbsp;'token'&nbsp;and&nbsp;if&nbsp;generate_auth_sub_url&nbsp;was&nbsp;used&nbsp;to&nbsp;create<br>
the&nbsp;request,&nbsp;the&nbsp;token's&nbsp;valid&nbsp;scopes&nbsp;are&nbsp;included&nbsp;in&nbsp;a&nbsp;URL&nbsp;parameter&nbsp;whose<br>
name&nbsp;is&nbsp;specified&nbsp;in&nbsp;scopes_param_prefix.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;url:&nbsp;atom.url.Url&nbsp;or&nbsp;str&nbsp;representing&nbsp;the&nbsp;current&nbsp;URL.&nbsp;The&nbsp;token&nbsp;value<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;valid&nbsp;scopes&nbsp;should&nbsp;be&nbsp;included&nbsp;as&nbsp;URL&nbsp;parameters.<br>
&nbsp;&nbsp;scopes_param_prefix:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;URL&nbsp;parameter&nbsp;key&nbsp;which&nbsp;maps&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;list&nbsp;of&nbsp;valid&nbsp;scopes&nbsp;for&nbsp;the&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;containing&nbsp;the&nbsp;token&nbsp;value&nbsp;as&nbsp;a&nbsp;string,&nbsp;and&nbsp;a&nbsp;tuple&nbsp;of&nbsp;scopes<br>
&nbsp;&nbsp;(as&nbsp;atom.http_core.Uri&nbsp;objects)&nbsp;which&nbsp;are&nbsp;URL&nbsp;prefixes&nbsp;under&nbsp;which&nbsp;this<br>
&nbsp;&nbsp;token&nbsp;grants&nbsp;permission&nbsp;to&nbsp;read&nbsp;and&nbsp;write&nbsp;user&nbsp;data.<br>
&nbsp;&nbsp;(token_string,&nbsp;(scope_uri,&nbsp;scope_uri,&nbsp;scope_uri,&nbsp;...))<br>
&nbsp;&nbsp;If&nbsp;no&nbsp;scopes&nbsp;were&nbsp;included&nbsp;in&nbsp;the&nbsp;URL,&nbsp;the&nbsp;second&nbsp;value&nbsp;in&nbsp;the&nbsp;tuple&nbsp;is<br>
&nbsp;&nbsp;None.&nbsp;If&nbsp;there&nbsp;was&nbsp;no&nbsp;token&nbsp;param&nbsp;in&nbsp;the&nbsp;url,&nbsp;the&nbsp;tuple&nbsp;returned&nbsp;is<br>
&nbsp;&nbsp;(None,&nbsp;None)</tt></dd></dl>
 <dl><dt><a name="-authorize_request_token"><strong>authorize_request_token</strong></a>(request_token, url)</dt><dd><tt>Adds&nbsp;information&nbsp;to&nbsp;request&nbsp;token&nbsp;to&nbsp;allow&nbsp;it&nbsp;to&nbsp;become&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;<br>
Modifies&nbsp;the&nbsp;request_token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;passed&nbsp;in&nbsp;by&nbsp;setting&nbsp;and&nbsp;unsetting&nbsp;the<br>
necessary&nbsp;fields&nbsp;to&nbsp;allow&nbsp;this&nbsp;token&nbsp;to&nbsp;form&nbsp;a&nbsp;valid&nbsp;upgrade&nbsp;request.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;request_token:&nbsp;The&nbsp;OAuth&nbsp;request&nbsp;token&nbsp;which&nbsp;has&nbsp;been&nbsp;authorized&nbsp;by&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;user.&nbsp;In&nbsp;order&nbsp;for&nbsp;this&nbsp;token&nbsp;to&nbsp;be&nbsp;upgraded&nbsp;to&nbsp;an&nbsp;access&nbsp;token,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;certain&nbsp;fields&nbsp;must&nbsp;be&nbsp;extracted&nbsp;from&nbsp;the&nbsp;URL&nbsp;and&nbsp;added&nbsp;to&nbsp;the&nbsp;token<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;so&nbsp;that&nbsp;they&nbsp;can&nbsp;be&nbsp;passed&nbsp;in&nbsp;an&nbsp;upgrade-token&nbsp;request.<br>
&nbsp;&nbsp;url:&nbsp;The&nbsp;URL&nbsp;of&nbsp;the&nbsp;current&nbsp;page&nbsp;which&nbsp;the&nbsp;user's&nbsp;browser&nbsp;was&nbsp;redirected<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;after&nbsp;they&nbsp;authorized&nbsp;access&nbsp;for&nbsp;the&nbsp;app.&nbsp;This&nbsp;function&nbsp;extracts<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;information&nbsp;from&nbsp;the&nbsp;URL&nbsp;which&nbsp;is&nbsp;needed&nbsp;to&nbsp;upgraded&nbsp;the&nbsp;token&nbsp;from<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;request&nbsp;token&nbsp;to&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>
 <dl><dt><a name="-build_auth_sub_data"><strong>build_auth_sub_data</strong></a>(http_request, timestamp, nonce)</dt><dd><tt>Creates&nbsp;the&nbsp;data&nbsp;string&nbsp;which&nbsp;must&nbsp;be&nbsp;RSA-signed&nbsp;in&nbsp;secure&nbsp;requests.<br>
&nbsp;<br>
For&nbsp;more&nbsp;details&nbsp;see&nbsp;the&nbsp;documenation&nbsp;on&nbsp;secure&nbsp;AuthSub&nbsp;requests:<br>
<a href="http://code.google.com/apis/accounts/docs/AuthSub.html#signingrequests">http://code.google.com/apis/accounts/docs/AuthSub.html#signingrequests</a><br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_request:&nbsp;The&nbsp;request&nbsp;being&nbsp;made&nbsp;to&nbsp;the&nbsp;server.&nbsp;The&nbsp;Request's&nbsp;URL<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;must&nbsp;be&nbsp;complete&nbsp;before&nbsp;this&nbsp;signature&nbsp;is&nbsp;calculated&nbsp;as&nbsp;any&nbsp;changes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;the&nbsp;URL&nbsp;will&nbsp;invalidate&nbsp;the&nbsp;signature.<br>
&nbsp;&nbsp;nonce:&nbsp;str&nbsp;Random&nbsp;64-bit,&nbsp;unsigned&nbsp;number&nbsp;encoded&nbsp;as&nbsp;an&nbsp;ASCII&nbsp;string&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;decimal&nbsp;format.&nbsp;The&nbsp;nonce/timestamp&nbsp;pair&nbsp;should&nbsp;always&nbsp;be&nbsp;unique&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prevent&nbsp;replay&nbsp;attacks.<br>
&nbsp;&nbsp;timestamp:&nbsp;Integer&nbsp;representing&nbsp;the&nbsp;time&nbsp;the&nbsp;request&nbsp;is&nbsp;sent.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timestamp&nbsp;should&nbsp;be&nbsp;expressed&nbsp;in&nbsp;number&nbsp;of&nbsp;seconds&nbsp;after&nbsp;January&nbsp;1,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1970&nbsp;00:00:00&nbsp;GMT.</tt></dd></dl>
 <dl><dt><a name="-build_oauth_base_string"><strong>build_oauth_base_string</strong></a>(http_request, consumer_key, nonce, signaure_type, timestamp, version, next<font color="#909090">='oob'</font>, token<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt><dd><tt>Generates&nbsp;the&nbsp;base&nbsp;string&nbsp;to&nbsp;be&nbsp;signed&nbsp;in&nbsp;the&nbsp;OAuth&nbsp;request.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_request:&nbsp;The&nbsp;request&nbsp;being&nbsp;made&nbsp;to&nbsp;the&nbsp;server.&nbsp;The&nbsp;Request's&nbsp;URL<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;must&nbsp;be&nbsp;complete&nbsp;before&nbsp;this&nbsp;signature&nbsp;is&nbsp;calculated&nbsp;as&nbsp;any&nbsp;changes<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;the&nbsp;URL&nbsp;will&nbsp;invalidate&nbsp;the&nbsp;signature.<br>
&nbsp;&nbsp;consumer_key:&nbsp;Domain&nbsp;identifying&nbsp;the&nbsp;third-party&nbsp;web&nbsp;application.&nbsp;This&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;domain&nbsp;used&nbsp;when&nbsp;registering&nbsp;the&nbsp;application&nbsp;with&nbsp;Google.&nbsp;It<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;identifies&nbsp;who&nbsp;is&nbsp;making&nbsp;the&nbsp;request&nbsp;on&nbsp;behalf&nbsp;of&nbsp;the&nbsp;user.<br>
&nbsp;&nbsp;nonce:&nbsp;Random&nbsp;64-bit,&nbsp;unsigned&nbsp;number&nbsp;encoded&nbsp;as&nbsp;an&nbsp;ASCII&nbsp;string&nbsp;in&nbsp;decimal<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;format.&nbsp;The&nbsp;nonce/timestamp&nbsp;pair&nbsp;should&nbsp;always&nbsp;be&nbsp;unique&nbsp;to&nbsp;prevent<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replay&nbsp;attacks.<br>
&nbsp;&nbsp;signaure_type:&nbsp;either&nbsp;RSA_SHA1&nbsp;or&nbsp;HMAC_SHA1<br>
&nbsp;&nbsp;timestamp:&nbsp;Integer&nbsp;representing&nbsp;the&nbsp;time&nbsp;the&nbsp;request&nbsp;is&nbsp;sent.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timestamp&nbsp;should&nbsp;be&nbsp;expressed&nbsp;in&nbsp;number&nbsp;of&nbsp;seconds&nbsp;after&nbsp;January&nbsp;1,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1970&nbsp;00:00:00&nbsp;GMT.<br>
&nbsp;&nbsp;version:&nbsp;The&nbsp;OAuth&nbsp;version&nbsp;used&nbsp;by&nbsp;the&nbsp;requesting&nbsp;web&nbsp;application.&nbsp;This<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value&nbsp;must&nbsp;be&nbsp;'1.0'&nbsp;or&nbsp;'1.0a'.&nbsp;If&nbsp;not&nbsp;provided,&nbsp;Google&nbsp;assumes&nbsp;version<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0&nbsp;is&nbsp;in&nbsp;use.<br>
&nbsp;&nbsp;next:&nbsp;The&nbsp;URL&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;redirected&nbsp;to&nbsp;after&nbsp;granting&nbsp;access<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;a&nbsp;Google&nbsp;service(s).&nbsp;It&nbsp;can&nbsp;include&nbsp;url-encoded&nbsp;query&nbsp;parameters.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;'oob'.&nbsp;(This&nbsp;is&nbsp;the&nbsp;oauth_callback.)<br>
&nbsp;&nbsp;token:&nbsp;The&nbsp;string&nbsp;for&nbsp;the&nbsp;OAuth&nbsp;request&nbsp;token&nbsp;or&nbsp;OAuth&nbsp;access&nbsp;token.<br>
&nbsp;&nbsp;verifier:&nbsp;str&nbsp;Sent&nbsp;as&nbsp;the&nbsp;oauth_verifier&nbsp;and&nbsp;required&nbsp;when&nbsp;upgrading&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request&nbsp;token&nbsp;to&nbsp;an&nbsp;access&nbsp;token.</tt></dd></dl>
 <dl><dt><a name="-dump_tokens"><strong>dump_tokens</strong></a>(tokens)</dt></dl>
 <dl><dt><a name="-find_scopes_for_services"><strong>find_scopes_for_services</strong></a>(service_names<font color="#909090">=None</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;combined&nbsp;list&nbsp;of&nbsp;scope&nbsp;URLs&nbsp;for&nbsp;the&nbsp;desired&nbsp;services.<br>
&nbsp;<br>
This&nbsp;method&nbsp;searches&nbsp;the&nbsp;AUTH_SCOPES&nbsp;dictionary.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;service_names:&nbsp;list&nbsp;of&nbsp;strings&nbsp;(optional)&nbsp;Each&nbsp;name&nbsp;must&nbsp;be&nbsp;a&nbsp;key&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AUTH_SCOPES&nbsp;dictionary.&nbsp;If&nbsp;no&nbsp;list&nbsp;is&nbsp;provided&nbsp;(None)&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;resulting&nbsp;list&nbsp;will&nbsp;contain&nbsp;all&nbsp;scope&nbsp;URLs&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AUTH_SCOPES&nbsp;dict.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;URL&nbsp;strings&nbsp;which&nbsp;are&nbsp;the&nbsp;scopes&nbsp;needed&nbsp;to&nbsp;access&nbsp;these&nbsp;services<br>
&nbsp;&nbsp;when&nbsp;requesting&nbsp;a&nbsp;token&nbsp;using&nbsp;AuthSub&nbsp;or&nbsp;OAuth.</tt></dd></dl>
 <dl><dt><a name="-generate_auth_header"><strong>generate_auth_header</strong></a>(consumer_key, timestamp, nonce, signature_type, signature, version<font color="#909090">='1.0'</font>, next<font color="#909090">=None</font>, token<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt><dd><tt>Builds&nbsp;the&nbsp;Authorization&nbsp;header&nbsp;to&nbsp;be&nbsp;sent&nbsp;in&nbsp;the&nbsp;request.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;consumer_key:&nbsp;Identifies&nbsp;the&nbsp;application&nbsp;making&nbsp;the&nbsp;request&nbsp;(str).<br>
&nbsp;&nbsp;timestamp:<br>
&nbsp;&nbsp;nonce:<br>
&nbsp;&nbsp;signature_type:&nbsp;One&nbsp;of&nbsp;either&nbsp;HMAC_SHA1&nbsp;or&nbsp;RSA_SHA1<br>
&nbsp;&nbsp;signature:&nbsp;The&nbsp;HMAC&nbsp;or&nbsp;RSA&nbsp;signature&nbsp;for&nbsp;the&nbsp;request&nbsp;as&nbsp;a&nbsp;base64<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;encoded&nbsp;string.<br>
&nbsp;&nbsp;version:&nbsp;The&nbsp;version&nbsp;of&nbsp;the&nbsp;OAuth&nbsp;protocol&nbsp;that&nbsp;this&nbsp;request&nbsp;is&nbsp;using.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default&nbsp;is&nbsp;'1.0'<br>
&nbsp;&nbsp;next:&nbsp;The&nbsp;URL&nbsp;of&nbsp;the&nbsp;page&nbsp;that&nbsp;the&nbsp;user's&nbsp;browser&nbsp;should&nbsp;be&nbsp;sent&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;after&nbsp;they&nbsp;authorize&nbsp;the&nbsp;token.&nbsp;(Optional)<br>
&nbsp;&nbsp;token:&nbsp;str&nbsp;The&nbsp;OAuth&nbsp;token&nbsp;value&nbsp;to&nbsp;be&nbsp;used&nbsp;in&nbsp;the&nbsp;oauth_token&nbsp;parameter<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;header.<br>
&nbsp;&nbsp;verifier:&nbsp;str&nbsp;The&nbsp;OAuth&nbsp;verifier&nbsp;which&nbsp;must&nbsp;be&nbsp;included&nbsp;when&nbsp;you&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;upgrading&nbsp;a&nbsp;request&nbsp;token&nbsp;to&nbsp;an&nbsp;access&nbsp;token.</tt></dd></dl>
 <dl><dt><a name="-generate_auth_sub_url"><strong>generate_auth_sub_url</strong></a>(next, scopes, secure<font color="#909090">=False</font>, session<font color="#909090">=True</font>, request_url<font color="#909090">=&lt;atom.http_core.Uri object&gt;</font>, domain<font color="#909090">='default'</font>, scopes_param_prefix<font color="#909090">='auth_sub_scopes'</font>)</dt><dd><tt>Constructs&nbsp;a&nbsp;URI&nbsp;for&nbsp;requesting&nbsp;a&nbsp;multiscope&nbsp;AuthSub&nbsp;token.<br>
&nbsp;<br>
The&nbsp;generated&nbsp;token&nbsp;will&nbsp;contain&nbsp;a&nbsp;URL&nbsp;parameter&nbsp;to&nbsp;pass&nbsp;along&nbsp;the<br>
requested&nbsp;scopes&nbsp;to&nbsp;the&nbsp;next&nbsp;URL.&nbsp;When&nbsp;the&nbsp;Google&nbsp;Accounts&nbsp;page<br>
redirects&nbsp;the&nbsp;broswser&nbsp;to&nbsp;the&nbsp;'next'&nbsp;URL,&nbsp;it&nbsp;appends&nbsp;the&nbsp;single&nbsp;use<br>
AuthSub&nbsp;token&nbsp;value&nbsp;to&nbsp;the&nbsp;URL&nbsp;as&nbsp;a&nbsp;URL&nbsp;parameter&nbsp;with&nbsp;the&nbsp;key&nbsp;'token'.<br>
However,&nbsp;the&nbsp;information&nbsp;about&nbsp;which&nbsp;scopes&nbsp;were&nbsp;requested&nbsp;is&nbsp;not<br>
included&nbsp;by&nbsp;Google&nbsp;Accounts.&nbsp;This&nbsp;method&nbsp;adds&nbsp;the&nbsp;scopes&nbsp;to&nbsp;the&nbsp;next<br>
URL&nbsp;before&nbsp;making&nbsp;the&nbsp;request&nbsp;so&nbsp;that&nbsp;the&nbsp;redirect&nbsp;will&nbsp;be&nbsp;sent&nbsp;to<br>
a&nbsp;page,&nbsp;and&nbsp;both&nbsp;the&nbsp;token&nbsp;value&nbsp;and&nbsp;the&nbsp;list&nbsp;of&nbsp;scopes&nbsp;for&nbsp;which&nbsp;the&nbsp;token<br>
was&nbsp;requested.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;next:&nbsp;atom.http_core.Uri&nbsp;or&nbsp;string&nbsp;The&nbsp;URL&nbsp;user&nbsp;will&nbsp;be&nbsp;sent&nbsp;to&nbsp;after<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;authorizing&nbsp;this&nbsp;web&nbsp;application&nbsp;to&nbsp;access&nbsp;their&nbsp;data.<br>
&nbsp;&nbsp;scopes:&nbsp;list&nbsp;containint&nbsp;strings&nbsp;or&nbsp;atom.http_core.Uri&nbsp;objects.&nbsp;The&nbsp;URLs<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;services&nbsp;to&nbsp;be&nbsp;accessed.&nbsp;Could&nbsp;also&nbsp;be&nbsp;a&nbsp;single&nbsp;string<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;single&nbsp;atom.http_core.Uri&nbsp;for&nbsp;requesting&nbsp;just&nbsp;one&nbsp;scope.<br>
&nbsp;&nbsp;secure:&nbsp;boolean&nbsp;(optional)&nbsp;Determines&nbsp;whether&nbsp;or&nbsp;not&nbsp;the&nbsp;issued&nbsp;token<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;a&nbsp;secure&nbsp;token.<br>
&nbsp;&nbsp;session:&nbsp;boolean&nbsp;(optional)&nbsp;Determines&nbsp;whether&nbsp;or&nbsp;not&nbsp;the&nbsp;issued&nbsp;token<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;be&nbsp;upgraded&nbsp;to&nbsp;a&nbsp;session&nbsp;token.<br>
&nbsp;&nbsp;request_url:&nbsp;atom.http_core.Uri&nbsp;or&nbsp;str&nbsp;The&nbsp;beginning&nbsp;of&nbsp;the&nbsp;request&nbsp;URL.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;is&nbsp;normally<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<a href="http://www.google.com/accounts/AuthSubRequest">http://www.google.com/accounts/AuthSubRequest</a>'&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'/accounts/AuthSubRequest'<br>
&nbsp;&nbsp;domain:&nbsp;The&nbsp;domain&nbsp;which&nbsp;the&nbsp;account&nbsp;is&nbsp;part&nbsp;of.&nbsp;This&nbsp;is&nbsp;used&nbsp;for&nbsp;Google<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Apps&nbsp;accounts,&nbsp;the&nbsp;default&nbsp;value&nbsp;is&nbsp;'default'&nbsp;which&nbsp;means&nbsp;that<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;requested&nbsp;account&nbsp;is&nbsp;a&nbsp;Google&nbsp;Account&nbsp;(@gmail.com&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;example)<br>
&nbsp;&nbsp;scopes_param_prefix:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;requested&nbsp;scopes&nbsp;are&nbsp;added&nbsp;as&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL&nbsp;parameter&nbsp;to&nbsp;the&nbsp;next&nbsp;URL&nbsp;so&nbsp;that&nbsp;the&nbsp;page&nbsp;at<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;'next'&nbsp;URL&nbsp;can&nbsp;extract&nbsp;the&nbsp;token&nbsp;value&nbsp;and&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;valid&nbsp;scopes&nbsp;from&nbsp;the&nbsp;URL.&nbsp;The&nbsp;key&nbsp;for&nbsp;the&nbsp;URL<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameter&nbsp;defaults&nbsp;to&nbsp;'auth_sub_scopes'<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;atom.http_core.Uri&nbsp;which&nbsp;the&nbsp;user's&nbsp;browser&nbsp;should&nbsp;be&nbsp;directed&nbsp;to&nbsp;in<br>
&nbsp;&nbsp;order&nbsp;to&nbsp;authorize&nbsp;this&nbsp;application&nbsp;to&nbsp;access&nbsp;their&nbsp;information.</tt></dd></dl>
 <dl><dt><a name="-generate_client_login_request_body"><strong>generate_client_login_request_body</strong></a>(email, password, service, source, account_type<font color="#909090">='HOSTED_OR_GOOGLE'</font>, captcha_token<font color="#909090">=None</font>, captcha_response<font color="#909090">=None</font>)</dt><dd><tt>Creates&nbsp;the&nbsp;body&nbsp;of&nbsp;the&nbsp;autentication&nbsp;request<br>
&nbsp;<br>
See&nbsp;<a href="http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request">http://code.google.com/apis/accounts/AuthForInstalledApps.html#Request</a><br>
for&nbsp;more&nbsp;details.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;email:&nbsp;str<br>
&nbsp;&nbsp;password:&nbsp;str<br>
&nbsp;&nbsp;service:&nbsp;str<br>
&nbsp;&nbsp;source:&nbsp;str<br>
&nbsp;&nbsp;account_type:&nbsp;str&nbsp;(optional)&nbsp;Defaul&nbsp;is&nbsp;'HOSTED_OR_GOOGLE',&nbsp;other&nbsp;valid<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;values&nbsp;are&nbsp;'GOOGLE'&nbsp;and&nbsp;'HOSTED'<br>
&nbsp;&nbsp;captcha_token:&nbsp;str&nbsp;(optional)<br>
&nbsp;&nbsp;captcha_response:&nbsp;str&nbsp;(optional)<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;HTTP&nbsp;body&nbsp;to&nbsp;send&nbsp;in&nbsp;a&nbsp;request&nbsp;for&nbsp;a&nbsp;client&nbsp;login&nbsp;token.</tt></dd></dl>
 <dl><dt><a name="-generate_hmac_signature"><strong>generate_hmac_signature</strong></a>(http_request, consumer_key, consumer_secret, timestamp, nonce, version, next<font color="#909090">='oob'</font>, token<font color="#909090">=None</font>, token_secret<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>
 <dl><dt><a name="-generate_oauth_authorization_url"><strong>generate_oauth_authorization_url</strong></a>(token, next<font color="#909090">=None</font>, hd<font color="#909090">='default'</font>, hl<font color="#909090">=None</font>, btmpl<font color="#909090">=None</font>, auth_server<font color="#909090">='https://www.google.com/accounts/OAuthAuthorizeToken'</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;URL&nbsp;for&nbsp;the&nbsp;page&nbsp;where&nbsp;the&nbsp;request&nbsp;token&nbsp;can&nbsp;be&nbsp;authorized.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token:&nbsp;str&nbsp;The&nbsp;request&nbsp;token&nbsp;from&nbsp;the&nbsp;OAuth&nbsp;server.<br>
&nbsp;&nbsp;next:&nbsp;str&nbsp;(optional)&nbsp;URL&nbsp;the&nbsp;user&nbsp;should&nbsp;be&nbsp;redirected&nbsp;to&nbsp;after&nbsp;granting<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;access&nbsp;to&nbsp;a&nbsp;Google&nbsp;service(s).&nbsp;It&nbsp;can&nbsp;include&nbsp;url-encoded&nbsp;query<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters.<br>
&nbsp;&nbsp;hd:&nbsp;str&nbsp;(optional)&nbsp;Identifies&nbsp;a&nbsp;particular&nbsp;hosted&nbsp;domain&nbsp;account&nbsp;to&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;accessed&nbsp;(for&nbsp;example,&nbsp;'mycollege.edu').&nbsp;Uses&nbsp;'default'&nbsp;to&nbsp;specify&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regular&nbsp;Google&nbsp;account&nbsp;('username@gmail.com').<br>
&nbsp;&nbsp;hl:&nbsp;str&nbsp;(optional)&nbsp;An&nbsp;ISO&nbsp;639&nbsp;country&nbsp;code&nbsp;identifying&nbsp;what&nbsp;language&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;approval&nbsp;page&nbsp;should&nbsp;be&nbsp;translated&nbsp;in&nbsp;(for&nbsp;example,&nbsp;'hl=en'&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;English).&nbsp;The&nbsp;default&nbsp;is&nbsp;the&nbsp;user's&nbsp;selected&nbsp;language.<br>
&nbsp;&nbsp;btmpl:&nbsp;str&nbsp;(optional)&nbsp;Forces&nbsp;a&nbsp;mobile&nbsp;version&nbsp;of&nbsp;the&nbsp;approval&nbsp;page.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;accepted&nbsp;value&nbsp;is&nbsp;'mobile'.<br>
&nbsp;&nbsp;auth_server:&nbsp;str&nbsp;(optional)&nbsp;The&nbsp;start&nbsp;of&nbsp;the&nbsp;token&nbsp;authorization&nbsp;web<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/accounts/OAuthAuthorizeToken'<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;atom.http_core.Uri&nbsp;pointing&nbsp;to&nbsp;the&nbsp;token&nbsp;authorization&nbsp;page&nbsp;where&nbsp;the<br>
&nbsp;&nbsp;user&nbsp;may&nbsp;allow&nbsp;or&nbsp;deny&nbsp;this&nbsp;app&nbsp;to&nbsp;access&nbsp;their&nbsp;Google&nbsp;data.</tt></dd></dl>
 <dl><dt><a name="-generate_request_for_access_token"><strong>generate_request_for_access_token</strong></a>(request_token, auth_server_url<font color="#909090">='https://www.google.com/accounts/OAuthGetAccessToken'</font>)</dt><dd><tt>Creates&nbsp;a&nbsp;request&nbsp;to&nbsp;ask&nbsp;the&nbsp;OAuth&nbsp;server&nbsp;for&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;<br>
Requires&nbsp;a&nbsp;request&nbsp;token&nbsp;which&nbsp;the&nbsp;user&nbsp;has&nbsp;authorized.&nbsp;See&nbsp;the<br>
documentation&nbsp;on&nbsp;OAuth&nbsp;with&nbsp;Google&nbsp;Data&nbsp;for&nbsp;more&nbsp;details:<br>
<a href="http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken">http://code.google.com/apis/accounts/docs/OAuth.html#AccessToken</a><br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;request_token:&nbsp;An&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a>&nbsp;or&nbsp;<a href="#OAuthRsaToken">OAuthRsaToken</a>&nbsp;which&nbsp;the&nbsp;user&nbsp;has<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;approved&nbsp;using&nbsp;their&nbsp;browser.<br>
&nbsp;&nbsp;auth_server_url:&nbsp;(optional)&nbsp;The&nbsp;URL&nbsp;at&nbsp;which&nbsp;the&nbsp;OAuth&nbsp;access&nbsp;token&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;requested.&nbsp;Defaults&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;https://www.google.com/accounts/OAuthGetAccessToken<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;new&nbsp;HttpRequest&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;can&nbsp;be&nbsp;sent&nbsp;to&nbsp;the&nbsp;OAuth&nbsp;server&nbsp;to<br>
&nbsp;&nbsp;request&nbsp;an&nbsp;OAuth&nbsp;Access&nbsp;Token.</tt></dd></dl>
 <dl><dt><a name="-generate_request_for_request_token"><strong>generate_request_for_request_token</strong></a>(consumer_key, signature_type, scopes, rsa_key<font color="#909090">=None</font>, consumer_secret<font color="#909090">=None</font>, auth_server_url<font color="#909090">='https://www.google.com/accounts/OAuthGetRequestToken'</font>, next<font color="#909090">='oob'</font>, version<font color="#909090">='1.0'</font>)</dt><dd><tt>Creates&nbsp;request&nbsp;to&nbsp;be&nbsp;sent&nbsp;to&nbsp;auth&nbsp;server&nbsp;to&nbsp;get&nbsp;an&nbsp;OAuth&nbsp;request&nbsp;token.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;consumer_key:<br>
&nbsp;&nbsp;signature_type:&nbsp;either&nbsp;RSA_SHA1&nbsp;or&nbsp;HMAC_SHA1.&nbsp;The&nbsp;rsa_key&nbsp;must&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;provided&nbsp;if&nbsp;the&nbsp;signature&nbsp;type&nbsp;is&nbsp;RSA&nbsp;but&nbsp;if&nbsp;the&nbsp;signature&nbsp;method<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;HMAC,&nbsp;the&nbsp;consumer_secret&nbsp;must&nbsp;be&nbsp;used.<br>
&nbsp;&nbsp;scopes:&nbsp;List&nbsp;of&nbsp;URL&nbsp;prefixes&nbsp;for&nbsp;the&nbsp;data&nbsp;which&nbsp;we&nbsp;want&nbsp;to&nbsp;access.&nbsp;For<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;example,&nbsp;to&nbsp;request&nbsp;access&nbsp;to&nbsp;the&nbsp;user's&nbsp;Blogger&nbsp;and&nbsp;Google&nbsp;Calendar<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data,&nbsp;we&nbsp;would&nbsp;request<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;['<a href="http://www.blogger.com/feeds/">http://www.blogger.com/feeds/</a>',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'https://www.google.com/calendar/feeds/',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<a href="http://www.google.com/calendar/feeds/">http://www.google.com/calendar/feeds/</a>']<br>
&nbsp;&nbsp;rsa_key:&nbsp;Only&nbsp;used&nbsp;if&nbsp;the&nbsp;signature&nbsp;method&nbsp;is&nbsp;RSA_SHA1.<br>
&nbsp;&nbsp;consumer_secret:&nbsp;Only&nbsp;used&nbsp;if&nbsp;the&nbsp;signature&nbsp;method&nbsp;is&nbsp;HMAC_SHA1.<br>
&nbsp;&nbsp;auth_server_url:&nbsp;The&nbsp;URL&nbsp;to&nbsp;which&nbsp;the&nbsp;token&nbsp;request&nbsp;should&nbsp;be&nbsp;directed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Defaults&nbsp;to&nbsp;'https://www.google.com/accounts/OAuthGetRequestToken'.<br>
&nbsp;&nbsp;next:&nbsp;The&nbsp;URL&nbsp;of&nbsp;the&nbsp;page&nbsp;that&nbsp;the&nbsp;user's&nbsp;browser&nbsp;should&nbsp;be&nbsp;sent&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;after&nbsp;they&nbsp;authorize&nbsp;the&nbsp;token.&nbsp;(Optional)<br>
&nbsp;&nbsp;version:&nbsp;The&nbsp;OAuth&nbsp;version&nbsp;used&nbsp;by&nbsp;the&nbsp;requesting&nbsp;web&nbsp;application.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Defaults&nbsp;to&nbsp;'1.0a'<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;An&nbsp;atom.http_core.HttpRequest&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;the&nbsp;URL,&nbsp;Authorization&nbsp;header<br>
&nbsp;&nbsp;and&nbsp;body&nbsp;filled&nbsp;in.</tt></dd></dl>
 <dl><dt><a name="-generate_rsa_signature"><strong>generate_rsa_signature</strong></a>(http_request, consumer_key, rsa_key, timestamp, nonce, version, next<font color="#909090">='oob'</font>, token<font color="#909090">=None</font>, token_secret<font color="#909090">=None</font>, verifier<font color="#909090">=None</font>)</dt></dl>
 <dl><dt><a name="-generate_signature"><strong>generate_signature</strong></a>(data, rsa_key)</dt><dd><tt>Signs&nbsp;the&nbsp;data&nbsp;string&nbsp;for&nbsp;a&nbsp;secure&nbsp;AuthSub&nbsp;request.</tt></dd></dl>
 <dl><dt><a name="-get_captcha_challenge"><strong>get_captcha_challenge</strong></a>(http_body, captcha_base_url<font color="#909090">='http://www.google.com/accounts/'</font>)</dt><dd><tt>Returns&nbsp;the&nbsp;URL&nbsp;and&nbsp;token&nbsp;for&nbsp;a&nbsp;CAPTCHA&nbsp;challenge&nbsp;issued&nbsp;by&nbsp;the&nbsp;server.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_body:&nbsp;str&nbsp;The&nbsp;body&nbsp;of&nbsp;the&nbsp;HTTP&nbsp;response&nbsp;from&nbsp;the&nbsp;server&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contains&nbsp;the&nbsp;CAPTCHA&nbsp;challenge.<br>
&nbsp;&nbsp;captcha_base_url:&nbsp;str&nbsp;This&nbsp;function&nbsp;returns&nbsp;a&nbsp;full&nbsp;URL&nbsp;for&nbsp;viewing&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;challenge&nbsp;image&nbsp;which&nbsp;is&nbsp;built&nbsp;from&nbsp;the&nbsp;server's&nbsp;response.&nbsp;This<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base_url&nbsp;is&nbsp;used&nbsp;as&nbsp;the&nbsp;beginning&nbsp;of&nbsp;the&nbsp;URL&nbsp;because&nbsp;the&nbsp;server<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;provides&nbsp;the&nbsp;end&nbsp;of&nbsp;the&nbsp;URL.&nbsp;For&nbsp;example&nbsp;the&nbsp;server&nbsp;provides<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'Captcha?ctoken=Hi...N'&nbsp;and&nbsp;the&nbsp;URL&nbsp;for&nbsp;the&nbsp;image&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'<a href="http://www.google.com/accounts/Captcha?ctoken=Hi...N">http://www.google.com/accounts/Captcha?ctoken=Hi...N</a>'<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;dictionary&nbsp;containing&nbsp;the&nbsp;information&nbsp;needed&nbsp;to&nbsp;repond&nbsp;to&nbsp;the&nbsp;CAPTCHA<br>
&nbsp;&nbsp;challenge,&nbsp;the&nbsp;image&nbsp;URL&nbsp;and&nbsp;the&nbsp;ID&nbsp;token&nbsp;of&nbsp;the&nbsp;challenge.&nbsp;The<br>
&nbsp;&nbsp;dictionary&nbsp;is&nbsp;in&nbsp;the&nbsp;form:<br>
&nbsp;&nbsp;{'token':&nbsp;string&nbsp;identifying&nbsp;the&nbsp;CAPTCHA&nbsp;image,<br>
&nbsp;&nbsp;&nbsp;'url':&nbsp;string&nbsp;containing&nbsp;the&nbsp;URL&nbsp;of&nbsp;the&nbsp;image}<br>
&nbsp;&nbsp;Returns&nbsp;None&nbsp;if&nbsp;there&nbsp;was&nbsp;no&nbsp;CAPTCHA&nbsp;challenge&nbsp;in&nbsp;the&nbsp;response.</tt></dd></dl>
 <dl><dt><a name="-get_client_login_token_string"><strong>get_client_login_token_string</strong></a>(http_body)</dt><dd><tt>Returns&nbsp;the&nbsp;token&nbsp;value&nbsp;for&nbsp;a&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>.<br>
&nbsp;<br>
Reads&nbsp;the&nbsp;token&nbsp;from&nbsp;the&nbsp;server's&nbsp;response&nbsp;to&nbsp;a&nbsp;Client&nbsp;Login&nbsp;request&nbsp;and<br>
creates&nbsp;the&nbsp;token&nbsp;value&nbsp;string&nbsp;to&nbsp;use&nbsp;in&nbsp;requests.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;http_body:&nbsp;str&nbsp;The&nbsp;body&nbsp;of&nbsp;the&nbsp;server's&nbsp;HTTP&nbsp;response&nbsp;to&nbsp;a&nbsp;Client&nbsp;Login<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;token&nbsp;value&nbsp;string&nbsp;for&nbsp;a&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>.</tt></dd></dl>
 <dl><dt><a name="-hmac_token_from_body"><strong>hmac_token_from_body</strong></a>(http_body, consumer_key, consumer_secret, auth_state)</dt></dl>
 <dl><dt><a name="-load_tokens"><strong>load_tokens</strong></a>(blob)</dt></dl>
 <dl><dt><a name="-oauth_token_info_from_body"><strong>oauth_token_info_from_body</strong></a>(http_body)</dt><dd><tt>Exracts&nbsp;an&nbsp;OAuth&nbsp;request&nbsp;token&nbsp;from&nbsp;the&nbsp;server's&nbsp;response.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;strings&nbsp;containing&nbsp;the&nbsp;OAuth&nbsp;token&nbsp;and&nbsp;token&nbsp;secret.&nbsp;If<br>
&nbsp;&nbsp;neither&nbsp;of&nbsp;these&nbsp;are&nbsp;present&nbsp;in&nbsp;the&nbsp;body,&nbsp;returns&nbsp;(None,&nbsp;None)</tt></dd></dl>
 <dl><dt><a name="-oauth_token_info_from_url"><strong>oauth_token_info_from_url</strong></a>(url)</dt><dd><tt>Exracts&nbsp;an&nbsp;OAuth&nbsp;access&nbsp;token&nbsp;from&nbsp;the&nbsp;redirected&nbsp;page's&nbsp;URL.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;strings&nbsp;containing&nbsp;the&nbsp;OAuth&nbsp;token&nbsp;and&nbsp;the&nbsp;OAuth&nbsp;verifier&nbsp;which<br>
&nbsp;&nbsp;need&nbsp;to&nbsp;sent&nbsp;when&nbsp;upgrading&nbsp;a&nbsp;request&nbsp;token&nbsp;to&nbsp;an&nbsp;access&nbsp;token.</tt></dd></dl>
 <dl><dt><a name="-rsa_token_from_body"><strong>rsa_token_from_body</strong></a>(http_body, consumer_key, rsa_private_key, auth_state)</dt></dl>
 <dl><dt><a name="-token_from_blob"><strong>token_from_blob</strong></a>(blob)</dt><dd><tt>Deserializes&nbsp;a&nbsp;token&nbsp;string&nbsp;from&nbsp;the&nbsp;datastore&nbsp;back&nbsp;into&nbsp;a&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>.<br>
&nbsp;<br>
Supported&nbsp;token&nbsp;classes:&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>,&nbsp;<a href="#AuthSubToken">AuthSubToken</a>,&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>,&nbsp;and&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a>,&nbsp;<a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a>&nbsp;and&nbsp;<a href="#OAuth2Token">OAuth2Token</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;blob:&nbsp;string&nbsp;created&nbsp;by&nbsp;token_to_blob.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;<a href="#UnsupportedTokenType">UnsupportedTokenType</a>&nbsp;if&nbsp;the&nbsp;token&nbsp;is&nbsp;not&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token<br>
&nbsp;&nbsp;classes&nbsp;listed&nbsp;above.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;new&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;with&nbsp;members&nbsp;set&nbsp;to&nbsp;the&nbsp;values&nbsp;serialized&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;blob&nbsp;string.&nbsp;Note&nbsp;that&nbsp;any&nbsp;members&nbsp;which&nbsp;were&nbsp;set&nbsp;to&nbsp;''&nbsp;in&nbsp;the&nbsp;original<br>
&nbsp;&nbsp;token&nbsp;will&nbsp;now&nbsp;be&nbsp;None.</tt></dd></dl>
 <dl><dt><a name="-token_to_blob"><strong>token_to_blob</strong></a>(token)</dt><dd><tt>Serializes&nbsp;the&nbsp;token&nbsp;data&nbsp;as&nbsp;a&nbsp;string&nbsp;for&nbsp;storage&nbsp;in&nbsp;a&nbsp;datastore.<br>
&nbsp;<br>
Supported&nbsp;token&nbsp;classes:&nbsp;<a href="#ClientLoginToken">ClientLoginToken</a>,&nbsp;<a href="#AuthSubToken">AuthSubToken</a>,&nbsp;<a href="#SecureAuthSubToken">SecureAuthSubToken</a>,<br>
<a href="#OAuthRsaToken">OAuthRsaToken</a>,&nbsp;and&nbsp;<a href="#OAuthHmacToken">OAuthHmacToken</a>,&nbsp;<a href="#TwoLeggedOAuthRsaToken">TwoLeggedOAuthRsaToken</a>,<br>
<a href="#TwoLeggedOAuthHmacToken">TwoLeggedOAuthHmacToken</a>&nbsp;and&nbsp;<a href="#OAuth2Token">OAuth2Token</a>.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;token:&nbsp;A&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;must&nbsp;be&nbsp;of&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token&nbsp;classes.<br>
&nbsp;<br>
Raises:<br>
&nbsp;&nbsp;<a href="#UnsupportedTokenType">UnsupportedTokenType</a>&nbsp;if&nbsp;the&nbsp;token&nbsp;is&nbsp;not&nbsp;one&nbsp;of&nbsp;the&nbsp;supported&nbsp;token<br>
&nbsp;&nbsp;classes&nbsp;listed&nbsp;above.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;A&nbsp;string&nbsp;represenging&nbsp;this&nbsp;token.&nbsp;The&nbsp;string&nbsp;can&nbsp;be&nbsp;converted&nbsp;back&nbsp;into<br>
&nbsp;&nbsp;an&nbsp;equivalent&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;using&nbsp;token_from_blob.&nbsp;Note&nbsp;that&nbsp;any&nbsp;members<br>
&nbsp;&nbsp;which&nbsp;are&nbsp;set&nbsp;to&nbsp;''&nbsp;will&nbsp;be&nbsp;set&nbsp;to&nbsp;None&nbsp;when&nbsp;the&nbsp;token&nbsp;is&nbsp;deserialized<br>
&nbsp;&nbsp;by&nbsp;token_from_blob.</tt></dd></dl>
 <dl><dt><a name="-upgrade_to_access_token"><strong>upgrade_to_access_token</strong></a>(request_token, server_response_body)</dt><dd><tt>Extracts&nbsp;access&nbsp;token&nbsp;information&nbsp;from&nbsp;response&nbsp;to&nbsp;an&nbsp;upgrade&nbsp;request.<br>
&nbsp;<br>
Once&nbsp;the&nbsp;server&nbsp;has&nbsp;responded&nbsp;with&nbsp;the&nbsp;new&nbsp;token&nbsp;info&nbsp;for&nbsp;the&nbsp;OAuth<br>
access&nbsp;token,&nbsp;this&nbsp;method&nbsp;modifies&nbsp;the&nbsp;request_token&nbsp;to&nbsp;set&nbsp;and&nbsp;unset<br>
necessary&nbsp;fields&nbsp;to&nbsp;create&nbsp;valid&nbsp;OAuth&nbsp;authorization&nbsp;headers&nbsp;for&nbsp;requests.<br>
&nbsp;<br>
Args:<br>
&nbsp;&nbsp;request_token:&nbsp;An&nbsp;OAuth&nbsp;token&nbsp;which&nbsp;this&nbsp;function&nbsp;modifies&nbsp;to&nbsp;allow&nbsp;it<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;be&nbsp;used&nbsp;as&nbsp;an&nbsp;access&nbsp;token.<br>
&nbsp;&nbsp;server_response_body:&nbsp;str&nbsp;The&nbsp;server's&nbsp;response&nbsp;to&nbsp;an&nbsp;OAuthAuthorizeToken<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request.&nbsp;This&nbsp;should&nbsp;contain&nbsp;the&nbsp;new&nbsp;token&nbsp;and&nbsp;token_secret&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;used&nbsp;to&nbsp;generate&nbsp;the&nbsp;signature&nbsp;and&nbsp;parameters&nbsp;of&nbsp;the&nbsp;Authorization<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header&nbsp;in&nbsp;subsequent&nbsp;requests&nbsp;to&nbsp;Google&nbsp;Data&nbsp;APIs.<br>
&nbsp;<br>
Returns:<br>
&nbsp;&nbsp;The&nbsp;same&nbsp;token&nbsp;<a href="__builtin__.html#object">object</a>&nbsp;which&nbsp;was&nbsp;passed&nbsp;in.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>ACCESS_TOKEN</strong> = 3<br>
<strong>ACCESS_TOKEN_URL</strong> = 'https://www.google.com/accounts/OAuthGetAccessToken'<br>
<strong>AUTHORIZED_REQUEST_TOKEN</strong> = 2<br>
<strong>AUTHSUB_AUTH_LABEL</strong> = 'AuthSub token='<br>
<strong>AUTH_SCOPES</strong> = {'analytics': ('https://www.google.com/analytics/feeds/',), 'apps': ('https://apps-apis.google.com/a/feeds/user/', 'https://apps-apis.google.com/a/feeds/policies/', 'https://apps-apis.google.com/a/feeds/alias/', 'https://apps-apis.google.com/a/feeds/groups/', 'https://apps-apis.google.com/a/feeds/compliance/audit/', 'https://apps-apis.google.com/a/feeds/migration/', 'https://apps-apis.google.com/a/feeds/emailsettings/2.0/'), 'blogger': ('http://www.blogger.com/feeds/',), 'books': ('http://www.google.com/books/feeds/',), 'cl': ('https://www.google.com/calendar/feeds/', 'http://www.google.com/calendar/feeds/'), 'code': ('http://code.google.com/feeds/issues',), 'codesearch': ('http://www.google.com/codesearch/feeds/',), 'cp': ('https://www.google.com/m8/feeds/', 'http://www.google.com/m8/feeds/'), 'finance': ('http://finance.google.com/finance/feeds/',), 'gbase': ('http://base.google.com/base/feeds/', 'http://www.google.com/base/feeds/'), ...}<br>
<strong>DEFAULT_DOMAIN</strong> = 'default'<br>
<strong>HMAC_SHA1</strong> = 'HMAC-SHA1'<br>
<strong>OAUTH2_AUTH_LABEL</strong> = 'Bearer '<br>
<strong>OAUTH_AUTHORIZE_URL</strong> = 'https://www.google.com/accounts/OAuthAuthorizeToken'<br>
<strong>PROGRAMMATIC_AUTH_LABEL</strong> = 'GoogleLogin auth='<br>
<strong>REQUEST_TOKEN</strong> = 1<br>
<strong>REQUEST_TOKEN_URL</strong> = 'https://www.google.com/accounts/OAuthGetRequestToken'<br>
<strong>RSA_SHA1</strong> = 'RSA-SHA1'<br>
<strong>__author__</strong> = 'j.s@google.com (Jeff Scudder)'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">j.s@google.com&nbsp;(Jeff&nbsp;Scudder)</td></tr></table>
</body></html>